Convert apt::source to use apt::setting
[puppet-modules/puppetlabs-apt.git] / spec / classes / params_spec.rb
index 5c43bc64d2c7e8d660170ac749fab8b3e82f5d6c..9a75ade4dbaae38f82ac897ee1df7044f2411884 100644 (file)
@@ -1,6 +1,6 @@
 require 'spec_helper'
 describe 'apt::params', :type => :class do
-  let(:facts) { { :lsbdistid => 'Debian' } }
+  let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian' } }
   let (:title) { 'my_package' }
 
   it { should contain_apt__params }
@@ -14,7 +14,7 @@ describe 'apt::params', :type => :class do
 
   describe "With unknown lsbdistid" do
 
-    let(:facts) { { :lsbdistid => 'CentOS' } }
+    let(:facts) { { :lsbdistid => 'CentOS', :osfamily => 'Debian' } }
     let (:title) { 'my_package' }
 
     it do
@@ -24,4 +24,16 @@ describe 'apt::params', :type => :class do
     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