2012-04-12 02:49:30 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
describe 'apt::conf', :type => :define do
|
2015-02-18 20:43:50 +01:00
|
|
|
let :pre_condition do
|
|
|
|
'class { "apt": }'
|
|
|
|
end
|
2015-03-02 22:40:06 +01:00
|
|
|
let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :lsbdistcodename => 'wheezy' } }
|
2012-04-12 02:49:30 +02:00
|
|
|
let :title do
|
|
|
|
'norecommends'
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "when creating an apt preference" do
|
|
|
|
let :params do
|
|
|
|
{
|
|
|
|
:priority => '00',
|
|
|
|
:content => "Apt::Install-Recommends 0;\nApt::AutoRemove::InstallRecommends 1;\n"
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
let :filename do
|
|
|
|
"/etc/apt/apt.conf.d/00norecommends"
|
|
|
|
end
|
|
|
|
|
2015-02-24 22:20:29 +01:00
|
|
|
it { is_expected.to contain_file(filename).with({
|
2012-05-04 01:59:13 +02:00
|
|
|
'ensure' => 'present',
|
2014-08-31 15:46:57 +02:00
|
|
|
'content' => /Apt::Install-Recommends 0;\nApt::AutoRemove::InstallRecommends 1;/,
|
2012-04-12 02:49:30 +02:00
|
|
|
'owner' => 'root',
|
|
|
|
'group' => 'root',
|
|
|
|
'mode' => '0644',
|
|
|
|
})
|
|
|
|
}
|
|
|
|
end
|
2012-05-04 01:59:13 +02:00
|
|
|
|
|
|
|
describe "when removing an apt preference" do
|
|
|
|
let :params do
|
|
|
|
{
|
|
|
|
:ensure => 'absent',
|
|
|
|
:priority => '00',
|
|
|
|
:content => "Apt::Install-Recommends 0;\nApt::AutoRemove::InstallRecommends 1;\n"
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
let :filename do
|
|
|
|
"/etc/apt/apt.conf.d/00norecommends"
|
|
|
|
end
|
|
|
|
|
2015-02-24 22:20:29 +01:00
|
|
|
it { is_expected.to contain_file(filename).with({
|
2012-05-04 01:59:13 +02:00
|
|
|
'ensure' => 'absent',
|
2014-08-31 15:46:57 +02:00
|
|
|
'content' => /Apt::Install-Recommends 0;\nApt::AutoRemove::InstallRecommends 1;/,
|
2012-05-04 01:59:13 +02:00
|
|
|
'owner' => 'root',
|
|
|
|
'group' => 'root',
|
|
|
|
'mode' => '0644',
|
|
|
|
})
|
|
|
|
}
|
|
|
|
end
|
2012-04-12 02:49:30 +02:00
|
|
|
end
|