+
+ context 'with release is empty string' do
+ let :facts do
+ {
+ os: { family: 'Debian', name: 'Debian', release: { major: '7', full: '7.0' } },
+ lsbdistid: 'Debian',
+ osfamily: 'Debian',
+ puppetversion: Puppet.version,
+ }
+ end
+ let(:params) { { location: 'hello.there', release: '' } }
+
+ it { is_expected.to contain_apt__setting('list-my_source').with_content(%r{hello\.there main}) }
+ end
+
+ context 'with invalid pin' do
+ let :facts do
+ {
+ os: { family: 'Debian', name: 'Debian', release: { major: '7', full: '7.0' } },
+ lsbdistid: 'Debian',
+ lsbdistcodename: 'wheezy',
+ osfamily: 'Debian',
+ puppetversion: Puppet.version,
+ }
+ end
+ let :params do
+ {
+ location: 'hello.there',
+ pin: true,
+ }
+ end
+
+ it do
+ is_expected.to raise_error(Puppet::Error, %r{expects a value})
+ end
+ end
+
+ context 'with notify_update = undef (default)' do
+ let :facts do
+ {
+ os: { family: 'Debian', name: 'Debian', release: { major: '7', full: '7.0' } },
+ 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
+ {
+ os: { family: 'Debian', name: 'Debian', release: { major: '7', full: '7.0' } },
+ 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
+ {
+ os: { family: 'Debian', name: 'Debian', release: { major: '7', full: '7.0' } },
+ 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