(MODULES-3983) Update parallel_tests for ruby 2.0.0
[puppet-modules/puppetlabs-apt.git] / spec / classes / apt_spec.rb
index 7578d2eb78d80735f7a85932425e0c207f4117b9..53ef7bea49a1805ced7de19670db36464dd499b9 100644 (file)
@@ -155,7 +155,7 @@ describe 'apt' do
       'puppetlabs' => {
         'location'   => 'http://apt.puppetlabs.com',
         'repos'      => 'main',
-        'key'        => { 'id' => '47B320EB4C7C375AA9DAE1A01054B7A24BD6EC30', 'server' => 'pgp.mit.edu' },
+        'key'        => { 'id' => '6F6B15509CF8E59E6E469F327F438280EF8D349F', 'server' => 'pgp.mit.edu' },
       }
     } } }
 
@@ -177,6 +177,32 @@ describe 'apt' do
     it { is_expected.to contain_file('/etc/apt/sources.list.d/puppetlabs.list').with_content(/^deb http:\/\/apt.puppetlabs.com precise main$/) }
   end
 
+  context 'with confs defined on valid osfamily' do
+    let :facts do
+      { :osfamily        => 'Debian',
+        :lsbdistcodename => 'precise',
+        :lsbdistid       => 'Debian',
+        :puppetversion   => Puppet.version,
+      }
+    end
+    let(:params) { { :confs => {
+      'foo' => {
+        'content' => 'foo',
+      },
+      'bar' => {
+        'content' => 'bar',
+      }
+    } } }
+
+    it { is_expected.to contain_apt__conf('foo').with({
+        :content => 'foo',
+    })}
+
+    it { is_expected.to contain_apt__conf('bar').with({
+        :content => 'bar',
+    })}
+  end
+
   context 'with keys defined on valid osfamily' do
     let :facts do
       { :osfamily        => 'Debian',
@@ -189,7 +215,7 @@ describe 'apt' do
       '55BE302B' => {
         'server' => 'subkeys.pgp.net',
       },
-      '4BD6EC30' => {
+      'EF8D349F' => {
         'server' => 'pgp.mit.edu',
       }
     } } }
@@ -198,7 +224,7 @@ describe 'apt' do
         :server => 'subkeys.pgp.net',
     })}
 
-    it { is_expected.to contain_apt__key('4BD6EC30').with({
+    it { is_expected.to contain_apt__key('EF8D349F').with({
         :server => 'pgp.mit.edu',
     })}
   end
@@ -208,6 +234,7 @@ describe 'apt' do
       { :osfamily        => 'Debian',
         :lsbdistcodename => 'precise',
         :lsbdistid       => 'ubuntu',
+        :lsbdistrelease  => '12.04',
         :puppetversion   => Puppet.version,
       }
     end
@@ -237,6 +264,23 @@ describe 'apt' do
     it { is_expected.to contain_apt__setting('pref-banana')}
   end
 
+  context 'with pins defined on valid osfamily' do
+    let :facts do
+      { :osfamily        => 'Debian',
+        :lsbdistcodename => 'precise',
+        :lsbdistid       => 'Debian',
+        :puppetversion   => Puppet.version,
+      }
+    end
+    let(:params) { { :pins => {
+      'stable' => { 'priority' => 600, 'order' => 50 },
+      'testing' =>  { 'priority' => 700, 'order' => 100 },
+    } } }
+
+    it { is_expected.to contain_apt__pin('stable') }
+    it { is_expected.to contain_apt__pin('testing') }
+  end
+
   describe 'failing tests' do
     context "purge['sources.list']=>'banana'" do
       let(:params) { { :purge => { 'sources.list' => 'banana' }, } }