Merge pull request #489 from mhaskel/2.0.0-prep
[puppet-modules/puppetlabs-apt.git] / spec / classes / params_spec.rb
index 5c43bc64d2c7e8d660170ac749fab8b3e82f5d6c..f8599b36998d0fb3f6629c8118f6d6ee5dc5bca6 100644 (file)
@@ -1,27 +1,26 @@
 require 'spec_helper'
 describe 'apt::params', :type => :class do
-  let(:facts) { { :lsbdistid => 'Debian' } }
+  let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :lsbdistcodename => 'wheezy' } }
   let (:title) { 'my_package' }
 
-  it { should contain_apt__params }
+  it { is_expected.to contain_apt__params }
 
   # 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
+    expect(subject.resources.size).to eq(4)
   end
 
-  describe "With unknown lsbdistid" do
-
-    let(:facts) { { :lsbdistid => 'CentOS' } }
+  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, /Unsupported lsbdistid/)
+        is_expected.to compile
+      }.to raise_error(Puppet::Error, /Unable to determine lsbdistid, is lsb-release installed/)
     end
-
   end
+
 end