- context 'reset' do
- it 'fixes the sources.list' do
- shell('cp /etc/apt/sources.list /tmp')
- end
- end
-
- context 'always_apt_update => true' do
- it 'should work with no errors' do
- pp = <<-EOS
- class { 'apt': always_apt_update => true }
- EOS
-
- apply_manifest(pp, :catch_failures => true) do |r|
- expect(r.stdout).to match(/apt_update/)
- end
- end
- end
- context 'always_apt_update => false' do
- it 'should work with no errors' do
- pp = <<-EOS
- class { 'apt': always_apt_update => false }
- EOS
-
- apply_manifest(pp, :catch_failures => true) do |r|
- expect(r.stdout).to_not match(/apt_update/)
- end
- end
- end
-
- # disable_keys drops in a 99unauth file to ignore keys in
- # other files.
- context 'disable_keys => true' do
- it 'should work with no errors' do
- pp = <<-EOS
- class { 'apt': disable_keys => true }
- EOS
-
- apply_manifest(pp, :catch_failures => true)
- end
-
- describe file('/etc/apt/apt.conf.d/99unauth') do
- it { should be_file }
- it { should contain 'APT::Get::AllowUnauthenticated 1;' }
- end
- end
- context 'disable_keys => false' do
- it 'should work with no errors' do
- pp = <<-EOS
- class { 'apt': disable_keys => false }
- EOS
-
- apply_manifest(pp, :catch_failures => true)
- end
-
- describe file('/etc/apt/apt.conf.d/99unauth') do
- it { should_not be_file }
- end
- end