X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Fclasses%2Fparams_spec.rb;h=9a75ade4dbaae38f82ac897ee1df7044f2411884;hb=10f313cfb4138b34481e219e231251c15acc84da;hp=a0ec08ca4bdff4ad82b92ec3b8d25ff0f89553cf;hpb=2d688f4cdc121da434db873f818dd95977385a46;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/spec/classes/params_spec.rb b/spec/classes/params_spec.rb index a0ec08c..9a75ade 100644 --- a/spec/classes/params_spec.rb +++ b/spec/classes/params_spec.rb @@ -1,8 +1,9 @@ require 'spec_helper' describe 'apt::params', :type => :class do + let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian' } } let (:title) { 'my_package' } - it { should create_class("apt::params") } + it { should contain_apt__params } # There are 4 resources in this class currently # there should not be any more resources because it is a params class @@ -10,4 +11,29 @@ describe 'apt::params', :type => :class do 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 + + end + + describe "With lsb-release not installed" do + let(:facts) { { :lsbdistid => '', :osfamily => 'Debian' } } + let (:title) { 'my_package' } + + it do + expect { + should compile + }.to raise_error(Puppet::Error, /Unable to determine lsbdistid, is lsb-release installed/) + end + end + end