Merge pull request #466 from paroga/master
[puppet-modules/puppetlabs-apt.git] / spec / classes / apt_spec.rb
index 2c70e3e0901258b106a7c42e940131b35acf5e1c..d3ef34dfa3363c6d6843a53a5631ec926ba5792f 100644 (file)
@@ -37,6 +37,14 @@ describe 'apt', :type => :class do
       'notify' => 'Exec[apt_update]',
     })}
 
+    it 'should lay down /etc/apt/apt.conf.d/15update-stamp' do
+      should contain_file('/etc/apt/apt.conf.d/15update-stamp').with({
+        'group' => 'root',
+        'mode'  => '0644',
+        'owner' => 'root',
+      }).with_content(/APT::Update::Post-Invoke-Success \{"touch \/var\/lib\/apt\/periodic\/update-success-stamp 2>\/dev\/null \|\| true";\};/)
+    end
+
     it { should contain_file('old-proxy-file').that_notifies('Exec[apt_update]').only_with({
       'ensure' => 'absent',
       'path'   => '/etc/apt/apt.conf.d/proxy',
@@ -86,20 +94,20 @@ describe 'apt', :type => :class do
 
     it { should contain_file('99progressbar').only_with({
       'ensure'  => 'present',
-      'content' => 'Dpkg::Progress-Fancy "1";',
+      'content' => /Dpkg::Progress-Fancy "1";/,
       'path'    => '/etc/apt/apt.conf.d/99progressbar',
     })}
 
     it { should contain_file('99unauth').only_with({
       'ensure'  => 'present',
-      'content' => "APT::Get::AllowUnauthenticated 1;\n",
+      'content' => /APT::Get::AllowUnauthenticated 1;/,
       'path'    => '/etc/apt/apt.conf.d/99unauth',
     })}
 
     it { should contain_file('01proxy').that_notifies('Exec[apt_update]').only_with({
       'ensure'  => 'present',
       'path'    => '/etc/apt/apt.conf.d/01proxy',
-      'content' => "Acquire::http::Proxy \"http://foo:9876\";\n",
+      'content' => /Acquire::http::Proxy "http:\/\/foo:9876";/,
       'notify'  => 'Exec[apt_update]',
       'mode'    => '0644',
       'owner'   => 'root',
@@ -147,7 +155,7 @@ describe 'apt', :type => :class do
         'release'           => 'unstable',
         'repos'             => 'main contrib non-free',
         'required_packages' => 'debian-keyring debian-archive-keyring',
-        'key'               => '55BE302B',
+        'key'               => '150C8614919D8446E01E83AF9AA38DCD55BE302B',
         'key_server'        => 'subkeys.pgp.net',
         'pin'               => '-10',
         'include_src'       => true
@@ -155,7 +163,7 @@ describe 'apt', :type => :class do
       'puppetlabs' => {
         'location'   => 'http://apt.puppetlabs.com',
         'repos'      => 'main',
-        'key'        => '4BD6EC30',
+        'key'        => '47B320EB4C7C375AA9DAE1A01054B7A24BD6EC30',
         'key_server' => 'pgp.mit.edu',
       }
     } } }