X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Facceptance%2Fapt_spec.rb;h=97f00f1681abd418ebe5d00261b5d2556d7d5aef;hb=08043adb753210c12cbd704ea800898a17751ff6;hp=84b7f88281c1f6b7deda07779220f194ef4f200d;hpb=01cff19fa872fed5dc44284b02856a74823ba0e7;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/spec/acceptance/apt_spec.rb b/spec/acceptance/apt_spec.rb index 84b7f88..97f00f1 100644 --- a/spec/acceptance/apt_spec.rb +++ b/spec/acceptance/apt_spec.rb @@ -15,7 +15,7 @@ describe 'apt class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily') 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 @@ -26,7 +26,7 @@ describe 'apt class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily') 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 @@ -75,10 +75,13 @@ describe 'apt class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily') 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 @@ -117,10 +120,13 @@ describe 'apt class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily') 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 @@ -211,10 +217,7 @@ describe 'apt class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily') 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 @@ -268,6 +271,34 @@ describe 'apt class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily') 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')