let (:pre_condition) { "class{'::apt': always_apt_update => true}" }
it 'should trigger an apt-get update run' do
#set the apt_update exec's refreshonly attribute to false
- should contain_exec('apt_update').with({'refreshonly' => false })
+ is_expected.to contain_exec('apt_update').with({'refreshonly' => false })
end
['always','daily','weekly','reluctantly'].each do |update_frequency|
context "when apt::apt_update_frequency has the value of #{update_frequency}" do
let (:pre_condition) { "class{'::apt': always_apt_update => true, apt_update_frequency => '#{update_frequency}' }" }
it 'should trigger an apt-get update run' do
# set the apt_update exec's refreshonly attribute to false
- should contain_exec('apt_update').with({'refreshonly' => false})
+ is_expected.to contain_exec('apt_update').with({'refreshonly' => false})
end
end
context 'when $::apt_update_last_success is nil' do
let (:pre_condition) { "class{'::apt': always_apt_update => true, apt_update_frequency => '#{update_frequency}' }" }
it 'should trigger an apt-get update run' do
#set the apt_update exec\'s refreshonly attribute to false
- should contain_exec('apt_update').with({'refreshonly' => false})
+ is_expected.to contain_exec('apt_update').with({'refreshonly' => false})
end
end
end
let (:pre_condition) { "class{'::apt': always_apt_update => false, apt_update_frequency => 'always' }" }
it 'should trigger an apt-get update run' do
#set the apt_update exec's refreshonly attribute to false
- should contain_exec('apt_update').with({'refreshonly' => false})
+ is_expected.to contain_exec('apt_update').with({'refreshonly' => false})
end
end
end
let (:pre_condition) { "class{ '::apt': always_apt_update => false, apt_update_frequency => 'always' }" }
it 'should trigger an apt-get update run' do
#set the apt_update exec\'s refreshonly attribute to false
- should contain_exec('apt_update').with({'refreshonly' => false})
+ is_expected.to contain_exec('apt_update').with({'refreshonly' => false})
end
end
end
let (:pre_condition) { "class{ '::apt': always_apt_update => false, apt_update_frequency => 'reluctantly' }" }
it 'should not trigger an apt-get update run' do
#don't change the apt_update exec's refreshonly attribute. (it should be true)
- should contain_exec('apt_update').with({'refreshonly' => true})
+ is_expected.to contain_exec('apt_update').with({'refreshonly' => true})
end
end
end
let (:pre_condition) { "class{ '::apt': always_apt_update => false, apt_update_frequency => 'reluctantly' }" }
it 'should not trigger an apt-get update run' do
#don't change the apt_update exec's refreshonly attribute. (it should be true)
- should contain_exec('apt_update').with({'refreshonly' => true})
+ is_expected.to contain_exec('apt_update').with({'refreshonly' => true})
end
end
end
let (:pre_condition) { "class{ '::apt': always_apt_update => false, apt_update_frequency => '#{update_frequency}' }" }
it 'should trigger an apt-get update run' do
#set the apt_update exec\'s refreshonly attribute to false
- should contain_exec('apt_update').with({'refreshonly' => false})
+ is_expected.to contain_exec('apt_update').with({'refreshonly' => false})
end
end
end
let (:pre_condition) { "class{ '::apt': always_apt_update => false, apt_update_frequency => '#{update_frequency}' }" }
it 'should not trigger an apt-get update run' do
#don't change the apt_update exec\'s refreshonly attribute. (it should be true)
- should contain_exec('apt_update').with({'refreshonly' => true})
+ is_expected.to contain_exec('apt_update').with({'refreshonly' => true})
end
end
context 'when $::apt_update_last_success is nil' do
let (:pre_condition) { "class{ '::apt': always_apt_update => false, apt_update_frequency => '#{update_frequency}' }" }
it 'should trigger an apt-get update run' do
#set the apt_update exec\'s refreshonly attribute to false
- should contain_exec('apt_update').with({'refreshonly' => false})
+ is_expected.to contain_exec('apt_update').with({'refreshonly' => false})
end
end
end