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,
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
}
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',
+ 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'
)