X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Fclasses%2Fparams_spec.rb;h=3161cf0278b819b9b38529910b2210122fdd9006;hb=89c747ab3b2caad9b36b8ce53a693537f4db6f36;hp=9a75ade4dbaae38f82ac897ee1df7044f2411884;hpb=61080fb6760e3d28b04158a3a2e1f3a055a2854e;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/spec/classes/params_spec.rb b/spec/classes/params_spec.rb index 9a75ade..3161cf0 100644 --- a/spec/classes/params_spec.rb +++ b/spec/classes/params_spec.rb @@ -1,39 +1,22 @@ require 'spec_helper' describe 'apt::params', :type => :class do - let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian' } } - let (:title) { 'my_package' } - - it { should contain_apt__params } + let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :lsbdistcodename => 'wheezy', :puppetversion => Puppet.version, } } # There are 4 resources in this class currently # 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 - subject.resources.size.should == 4 - end - - describe "With unknown lsbdistid" do - - let(:facts) { { :lsbdistid => 'CentOS', :osfamily => 'Debian' } } - let (:title) { 'my_package' } - - it do - expect { - should 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 { - should 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