require 'spec_helper'
describe 'apt::source' do
- GPG_KEY_ID = '47B320EB4C7C375AA9DAE1A01054B7A24BD6EC30'
+ GPG_KEY_ID = '6F6B15509CF8E59E6E469F327F438280EF8D349F'
let :pre_condition do
'class { "apt": }'
it { is_expected.to contain_apt__setting('list-my_source').with({
:ensure => 'present',
- }).with_content(/# my_source\ndeb-src \[arch=x86_64 \] hello.there wheezy main\n/)
+ }).with_content(/# my_source\ndeb-src \[arch=x86_64\] hello.there wheezy main\n/)
}
end
end
end
+ context "with notify_update = undef (default)" do
+ let :facts do
+ {
+ :lsbdistid => 'Debian',
+ :lsbdistcodename => 'wheezy',
+ :osfamily => 'Debian',
+ :puppetversion => Puppet.version,
+ }
+ end
+ let :params do
+ {
+ :location => 'hello.there',
+ }
+ end
+ it { is_expected.to contain_apt__setting("list-#{title}").with_notify_update(true) }
+ end
+
+ context "with notify_update = true" do
+ let :facts do
+ {
+ :lsbdistid => 'Debian',
+ :lsbdistcodename => 'wheezy',
+ :osfamily => 'Debian',
+ :puppetversion => Puppet.version,
+ }
+ end
+ let :params do
+ {
+ :location => 'hello.there',
+ :notify_update => true,
+ }
+ end
+ it { is_expected.to contain_apt__setting("list-#{title}").with_notify_update(true) }
+ end
+
+ context "with notify_update = false" do
+ let :facts do
+ {
+ :lsbdistid => 'Debian',
+ :lsbdistcodename => 'wheezy',
+ :osfamily => 'Debian',
+ :puppetversion => Puppet.version,
+ }
+ end
+ let :params do
+ {
+ :location => 'hello.there',
+ :notify_update => false,
+ }
+ end
+ it { is_expected.to contain_apt__setting("list-#{title}").with_notify_update(false) }
+ end
+
end
end