3 context 'with sources defined on valid osfamily' do
5 { :osfamily => 'Debian',
6 :lsbdistcodename => 'precise',
7 :lsbdistid => 'Debian',
10 let(:params) { { :sources => {
11 'debian_unstable' => {
12 'location' => 'http://debian.mirror.iweb.ca/debian/',
13 'release' => 'unstable',
14 'repos' => 'main contrib non-free',
15 'required_packages' => 'debian-keyring debian-archive-keyring',
17 'key_server' => 'subkeys.pgp.net',
22 'location' => 'http://apt.puppetlabs.com',
25 'key_server' => 'pgp.mit.edu',
30 should contain_file('debian_unstable.list').with({
31 'ensure' => 'present',
32 'path' => '/etc/apt/sources.list.d/debian_unstable.list',
36 'notify' => 'Exec[apt_update]',
40 it { should contain_file('debian_unstable.list').with_content(/^deb http:\/\/debian.mirror.iweb.ca\/debian\/ unstable main contrib non-free$/) }
41 it { should contain_file('debian_unstable.list').with_content(/^deb-src http:\/\/debian.mirror.iweb.ca\/debian\/ unstable main contrib non-free$/) }
44 should contain_file('puppetlabs.list').with({
45 'ensure' => 'present',
46 'path' => '/etc/apt/sources.list.d/puppetlabs.list',
50 'notify' => 'Exec[apt_update]',
54 it { should contain_file('puppetlabs.list').with_content(/^deb http:\/\/apt.puppetlabs.com precise main$/) }
55 it { should contain_file('puppetlabs.list').with_content(/^deb-src http:\/\/apt.puppetlabs.com precise main$/) }
58 context 'with unsupported osfamily' do
60 { :osfamily => 'Darwin', }
66 }.to raise_error(Puppet::Error, /This module only works on Debian or derivatives like Ubuntu/)