- ['daily','weekly'].each do |update_frequency|
- context "and apt::update['frequency'] has the value of #{update_frequency}" do
- { 'we are due for a run' => 1406660561,'the update-success-stamp file does not exist' => -1 }.each_pair do |desc, factval|
- context "and $::apt_update_last_success indicates #{desc}" do
- let(:facts) { {
- :os => { :family => 'Debian', :name => 'Debian', :release => { :major => '7', :full => '7.0' }},
- :lsbdistid => 'Debian',
- :osfamily => 'Debian',
- :apt_update_last_success => factval,
- :lsbdistcodename => 'wheezy',
- :puppetversion => Puppet.version,
- } }
- let (:pre_condition) { "class{ '::apt': update => {'frequency' => '#{update_frequency}',} }" }
- it 'should trigger an apt-get update run' do
- #set the apt_update exec\'s refreshonly attribute to false
- is_expected.to contain_exec('apt_update').with({'refreshonly' => false})
+ %w[daily weekly].each do |update_frequency|
+ context "when apt::update['frequency'] has the value of #{update_frequency}" do
+ { 'we are due for a run' => 1_406_660_561, 'the update-success-stamp file does not exist' => -1 }.each_pair do |desc, factval|
+ context "when $::apt_update_last_success indicates #{desc}" do
+ let(:facts) do
+ {
+ os: { family: 'Debian', name: 'Debian', release: { major: '7', full: '7.0' } },
+ lsbdistid: 'Debian',
+ osfamily: 'Debian',
+ apt_update_last_success: factval,
+ lsbdistcodename: 'wheezy',
+ puppetversion: Puppet.version,
+ }
+ end
+ let(:pre_condition) { "class{ '::apt': update => {'frequency' => '#{update_frequency}',} }" }
+
+ it 'triggers an apt-get update run' do
+ # set the apt_update exec\'s refreshonly attribute to false
+ is_expected.to contain_exec('apt_update').with('refreshonly' => false)