X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Fclasses%2Fapt_spec.rb;h=a21e0443e2df715b221e712d9457607d26117611;hb=7492f375fe3ea625e71673eaddcd1e11f06aca40;hp=0da7d32db03088751687508d60e594e4f2843619;hpb=fd3e07e58fadc6efb25d524168575c39de0c5590;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/spec/classes/apt_spec.rb b/spec/classes/apt_spec.rb index 0da7d32..a21e044 100644 --- a/spec/classes/apt_spec.rb +++ b/spec/classes/apt_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' describe 'apt', :type => :class do - let(:facts) { { :lsbdistid => 'Debian' } } + let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian' } } let :default_params do { :disable_keys => :undef, @@ -93,22 +93,11 @@ describe 'apt', :type => :class do it { if param_hash[:purge_preferences] should create_file('apt-preferences').with({ - :ensure => 'present', + :ensure => 'absent', :path => '/etc/apt/preferences', - :owner => 'root', - :group => 'root', - :mode => '0644', - :content => /Explanation/, }) else - should create_file('apt-preferences').with({ - :ensure => 'present', - :path => '/etc/apt/preferences', - :owner => 'root', - :group => 'root', - :mode => '0644', - :content => nil, - }) + should_not contain_file('apt-preferences') end } @@ -162,14 +151,14 @@ describe 'apt', :type => :class do describe 'when setting a proxy' do it { if param_hash[:proxy_host] - should contain_file('configure-apt-proxy').with( - 'path' => '/etc/apt/apt.conf.d/proxy', - 'content' => "Acquire::http::Proxy \"http://#{param_hash[:proxy_host]}:#{param_hash[:proxy_port]}\";", + should contain_file('01proxy').with( + 'path' => '/etc/apt/apt.conf.d/01proxy', + 'content' => "Acquire::http::Proxy \"http://#{param_hash[:proxy_host]}:#{param_hash[:proxy_port]}\";\n", 'notify' => "Exec[apt_update]" ) else - should contain_file('configure-apt-proxy').with( - 'path' => '/etc/apt/apt.conf.d/proxy', + should contain_file('01proxy').with( + 'path' => '/etc/apt/apt.conf.d/01proxy', 'notify' => 'Exec[apt_update]', 'ensure' => 'absent' )