Merge pull request #494 from mhaskel/cleanup-backports
[puppet-modules/puppetlabs-apt.git] / spec / defines / pin_spec.rb
index 1421d68fbdefc96c05b968a71e57e3ed197e30bd..a11c3b5c253156dcae5b2866286932918f7c99ef 100644 (file)
@@ -3,16 +3,12 @@ describe 'apt::pin', :type => :define do
   let :pre_condition do
     'class { "apt": }'
   end
-  let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian' } }
+  let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :lsbdistcodename => 'wheezy' } }
   let(:title) { 'my_pin' }
 
   context 'defaults' do
     it { is_expected.to contain_apt__setting("pref-my_pin").with_content(/Explanation: : my_pin\nPackage: \*\nPin: release a=my_pin\nPin-Priority: 0\n/)}
-    it { is_expected.to contain_apt__setting("pref-my_pin").with({
-      'setting_type' => 'pref',
-      'base_name'    => 'my_pin',
-    })
-    }
+    it { is_expected.to contain_apt__setting("pref-my_pin") }
   end
 
   context 'set version' do
@@ -23,11 +19,7 @@ describe 'apt::pin', :type => :define do
       }
     end
     it { is_expected.to contain_apt__setting("pref-my_pin").with_content(/Explanation: : my_pin\nPackage: vim\nPin: version 1\nPin-Priority: 0\n/)}
-    it { is_expected.to contain_apt__setting("pref-my_pin").with({
-      'setting_type' => 'pref',
-      'base_name'    => 'my_pin',
-    })
-    }
+    it { is_expected.to contain_apt__setting("pref-my_pin") }
   end
 
   context 'set origin' do
@@ -38,11 +30,7 @@ describe 'apt::pin', :type => :define do
       }
     end
     it { is_expected.to contain_apt__setting("pref-my_pin").with_content(/Explanation: : my_pin\nPackage: vim\nPin: origin test\nPin-Priority: 0\n/)}
-    it { is_expected.to contain_apt__setting("pref-my_pin").with({
-      'setting_type' => 'pref',
-      'base_name'    => 'my_pin',
-    })
-    }
+    it { is_expected.to contain_apt__setting("pref-my_pin") }
   end
 
   context 'not defaults' do
@@ -61,8 +49,6 @@ describe 'apt::pin', :type => :define do
     end
     it { is_expected.to contain_apt__setting("pref-my_pin").with_content(/Explanation: foo\nPackage: \*\nPin: release a=1, n=bar, v=2, c=baz, o=foobar, l=foobaz\nPin-Priority: 10\n/) }
     it { is_expected.to contain_apt__setting("pref-my_pin").with({
-      'setting_type' => 'pref',
-      'base_name'    => 'my_pin',
       'priority'     => 99,
     })
     }