EOS
apply_manifest(pp, :catch_failures => true) do |r|
- expect(r.stdout).to match(/apt_update/)
+ expect(r.stdout).to match(/Exec\[apt_update\]/)
end
end
end
EOS
apply_manifest(pp, :catch_failures => true) do |r|
- expect(r.stdout).to_not match(/apt_update/)
+ expect(r.stdout).to_not match(/Exec\[apt_update\]/)
end
end
end
apply_manifest(pp, :catch_failures => true)
end
- describe file('/etc/apt/apt.conf.d/proxy') do
+ describe file('/etc/apt/apt.conf.d/01proxy') do
it { should be_file }
it { should contain 'Acquire::http::Proxy "http://localhost:7042\";' }
end
+ describe file('/etc/apt/apt.conf.d/proxy') do
+ it { should_not be_file }
+ end
end
context 'purge_sources' do
apply_manifest(pp, :catch_failures => true)
end
- describe file('/etc/apt/apt.conf.d/proxy') do
+ describe file('/etc/apt/apt.conf.d/01proxy') do
it { should be_file }
it { should contain 'Acquire::http::Proxy "http://localhost:7042\";' }
end
+ describe file('/etc/apt/apt.conf.d/proxy') do
+ it { should_not be_file }
+ end
end
context 'purge_sources' do
end
describe file('/etc/apt/preferences') do
- it { should be_file }
- it 'is managed by Puppet' do
- shell("grep 'Explanation' /etc/apt/preferences", {:acceptable_exit_codes => 0})
- end
+ it { should_not be_file }
end
end
end
end
end
+ context 'fancy_progress => true' do
+ it 'should work with no errors' do
+ pp = <<-EOS
+ class { 'apt': fancy_progress => true }
+ EOS
+
+ apply_manifest(pp, :catch_failures => true)
+ end
+
+ describe file('/etc/apt/apt.conf.d/99progressbar') do
+ it { should be_file }
+ it { should contain 'Dpkg::Progress-Fancy "1";' }
+ end
+ end
+ context 'fancy_progress => false' do
+ it 'should work with no errors' do
+ pp = <<-EOS
+ class { 'apt': fancy_progress => false }
+ EOS
+
+ apply_manifest(pp, :catch_failures => true)
+ end
+
+ describe file('/etc/apt/apt.conf.d/99progressbar') do
+ it { should_not be_file }
+ end
+ end
+
context 'reset' do
it 'fixes the sources.list' do
shell('cp /tmp/sources.list /etc/apt')