X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Fclasses%2Fparams_spec.rb;h=e9eb6fb9d6463936ef924a18cccf376ba0f72fab;hb=f05e43c28588a280a42333f9ca3a506a7121849d;hp=65759fad1d3e8929226a3843deeb1f868fc60ac6;hpb=fd71aedda76f60e87b3a996ab22e9f92af560ec2;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/spec/classes/params_spec.rb b/spec/classes/params_spec.rb index 65759fa..e9eb6fb 100644 --- a/spec/classes/params_spec.rb +++ b/spec/classes/params_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' describe 'apt::params', :type => :class do - let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian' } } + let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :lsbdistcodename => 'wheezy', :puppetversion => Puppet.version, } } let (:title) { 'my_package' } it { is_expected.to contain_apt__params } @@ -9,31 +9,17 @@ describe 'apt::params', :type => :class do # there should not be any more resources because it is a params class # The resources are class[apt::params], class[main], class[settings], stage[main] it "Should not contain any resources" do - expect(subject.resources.size).to eq(4) - end - - describe "With unknown lsbdistid" do - - let(:facts) { { :lsbdistid => 'CentOS', :osfamily => 'Debian' } } - let (:title) { 'my_package' } - - it do - expect { - is_expected.to compile - }.to raise_error(Puppet::Error, /Unsupported lsbdistid/) - end - + expect(subject.call.resources.size).to eq(4) end describe "With lsb-release not installed" do - let(:facts) { { :lsbdistid => '', :osfamily => 'Debian' } } + let(:facts) { { :osfamily => 'Debian', :puppetversion => Puppet.version, } } let (:title) { 'my_package' } it do expect { - is_expected.to compile - }.to raise_error(Puppet::Error, /Unable to determine lsbdistid, is lsb-release installed/) + subject.call + }.to raise_error(Puppet::Error, /Unable to determine lsbdistid, please install lsb-release first/) end end - end