end
context 'defaults' do
- let :facts do
- {
- :lsbdistid => 'Debian',
- :lsbdistcodename => 'wheezy',
- :osfamily => 'Debian'
- }
+ context 'without location' do
+ let :facts do
+ {
+ :lsbdistid => 'Debian',
+ :lsbdistcodename => 'wheezy',
+ :osfamily => 'Debian'
+ }
+ end
+ it do
+ expect {
+ is_expected.to compile
+ }.to raise_error(Puppet::Error, /source entry without specifying a location/)
+ end
end
+ context 'with location' do
+ let :facts do
+ {
+ :lsbdistid => 'Debian',
+ :lsbdistcodename => 'wheezy',
+ :osfamily => 'Debian'
+ }
+ end
+ let(:params) { { :location => 'hello.there', } }
- it { is_expected.to contain_apt__setting('list-my_source').with({
- :ensure => 'present',
- }).without_content(/# my_source\ndeb-src wheezy main\n/)
- }
+ it { is_expected.to contain_apt__setting('list-my_source').with({
+ :ensure => 'present',
+ }).without_content(/# my_source\ndeb-src hello.there wheezy main\n/)
+ }
+ end
end
describe 'no defaults' do
end
let :params do
{
+ :location => 'hello.there',
:allow_unsigned => true,
}
end
it { is_expected.to contain_apt__setting('list-my_source').with({
:ensure => 'present',
- }).with_content(/# my_source\ndeb \[trusted=yes\] wheezy main\n/)
+ }).with_content(/# my_source\ndeb \[trusted=yes\] hello.there wheezy main\n/)
}
end
end
let :params do
{
+ :location => 'hello.there',
:include => {'deb' => false, 'src' => true,},
:architecture => 'x86_64',
}
it { is_expected.to contain_apt__setting('list-my_source').with({
:ensure => 'present',
- }).with_content(/# my_source\ndeb-src \[arch=x86_64 \] wheezy main\n/)
+ }).with_content(/# my_source\ndeb-src \[arch=x86_64 \] hello.there wheezy main\n/)
}
end
:osfamily => 'Debian'
}
end
+ let(:params) { { :location => 'hello.there', } }
it do
expect {