{
'a recent run' => Time.now.to_i,
'we are due for a run' => 1_406_660_561,
- 'the update-success-stamp file does not exist' => -1,
+ '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
name: 'Debian',
release: {
major: '9',
- full: '9.0',
+ full: '9.0'
},
distro: {
codename: 'stretch',
- id: 'Debian',
- },
+ id: 'Debian'
+ }
},
- apt_update_last_success: factval,
+ apt_update_last_success: factval
}
end
let(:pre_condition) do
name: 'Debian',
release: {
major: '9',
- full: '9.0',
+ full: '9.0'
},
distro: {
codename: 'stretch',
- id: 'Debian',
- },
- },
+ id: 'Debian'
+ }
+ }
}
end
let(:pre_condition) { "class{ '::apt': update => {'frequency' => 'always' },}" }
end
end
- context 'and Exec[apt_update] refreshonly is overridden to true and has recent run' do
+ context 'when Exec[apt_update] refreshonly is overridden to true and has recent run' do
let(:facts) do
{
os: {
name: 'Debian',
release: {
major: '9',
- full: '9.0',
+ full: '9.0'
},
distro: {
codename: 'stretch',
- id: 'Debian',
- },
+ id: 'Debian'
+ }
},
- apt_update_last_success: Time.now.to_i,
+ apt_update_last_success: Time.now.to_i
}
end
let(:pre_condition) do
{
'a recent run' => Time.now.to_i,
'we are due for a run' => 1_406_660_561,
- 'the update-success-stamp file does not exist' => -1,
+ '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
name: 'Debian',
release: {
major: '9',
- full: '9.0',
+ full: '9.0'
},
distro: {
codename: 'stretch',
- id: 'Debian',
- },
+ id: 'Debian'
+ }
},
- apt_update_last_success: factval,
+ apt_update_last_success: factval
}
end
let(:pre_condition) { "class{ '::apt': update => {'frequency' => 'reluctantly' },}" }
name: 'Debian',
release: {
major: '9',
- full: '9.0',
+ full: '9.0'
},
distro: {
codename: 'stretch',
- id: 'Debian',
- },
- },
+ id: 'Debian'
+ }
+ }
}
end
let(:pre_condition) { "class{ '::apt': update => {'frequency' => 'reluctantly' },}" }
['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|
+ pair = { 'we are due for a run' => 1_406_660_561, 'the update-success-stamp file does not exist' => -1 }
+ pair.each_pair do |desc, factval|
context "when $apt_update_last_success indicates #{desc}" do
let(:facts) do
{
name: 'Debian',
release: {
major: '9',
- full: '9.0',
+ full: '9.0'
},
distro: {
codename: 'stretch',
- id: 'Debian',
- },
+ id: 'Debian'
+ }
},
- apt_update_last_success: factval,
+ apt_update_last_success: factval
}
end
let(:pre_condition) { "class{ '::apt': update => {'frequency' => '#{update_frequency}',} }" }
name: 'Debian',
release: {
major: '9',
- full: '9.0',
+ full: '9.0'
},
distro: {
codename: 'stretch',
- id: 'Debian',
- },
+ id: 'Debian'
+ }
},
- apt_update_last_success: Time.now.to_i,
+ apt_update_last_success: Time.now.to_i
}
end
let(:pre_condition) { "class{ '::apt': update => {'frequency' => '#{update_frequency}',} }" }
name: 'Debian',
release: {
major: '9',
- full: '9.0',
+ full: '9.0'
},
distro: {
codename: 'stretch',
- id: 'Debian',
- },
+ id: 'Debian'
+ }
},
- apt_update_last_success: nil,
+ apt_update_last_success: nil
}
end
let(:pre_condition) { "class{ '::apt': update => {'frequency' => '#{update_frequency}',} }" }