Merge pull request #18 from bodepd/apt_proxy_tests

(#12529) Add unit test for apt proxy settings
This commit is contained in:
Matthaus Litteken 2012-02-13 10:02:50 -08:00
commit 52adc3555c

View file

@ -10,7 +10,9 @@ describe 'apt', :type => :class do
[{},
{
:disable_keys => true,
:always_apt_update => true
:always_apt_update => true,
:proxy_host => true,
:proxy_port => '3128'
}
].each do |param_set|
describe "when #{param_set == {} ? "using default" : "specifying"} class parameters" do
@ -74,6 +76,18 @@ describe 'apt', :type => :class do
})
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',
'content' => "Acquire::http::Proxy \"http://#{param_hash[:proxy_host]}:#{param_hash[:proxy_port]}\";"
)
else
should_not contain_file('configure_apt_proxy')
end
}
end
end
end
end