From: Hunter Haugen Date: Thu, 11 Jul 2013 22:49:00 +0000 (-0700) Subject: Adding specs for proxy and apt::ppa X-Git-Tag: 1.3.0~9^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=4d8a99aead5c64556503f21599977b066395fae7;p=puppet-modules%2Fpuppetlabs-apt.git Adding specs for proxy and apt::ppa --- diff --git a/spec/defines/ppa_spec.rb b/spec/defines/ppa_spec.rb index 6be9ab9..3baa7e8 100644 --- a/spec/defines/ppa_spec.rb +++ b/spec/defines/ppa_spec.rb @@ -55,6 +55,31 @@ describe 'apt::ppa', :type => :define do } end end + describe 'behind a proxy' do + let :title do + 'rspec_ppa' + end + let :pre_condition do + 'class { "apt": + proxy_host => "user:pass@proxy", + }' + end + let :filename do + "#{title}-#{release}.list" + end + + it { should contain_exec("add-apt-repository-#{title}").with( + 'environment' => [ + "http_proxy=http://user:pass@proxy:8080", + "https_proxy=http://user:pass@proxy:8080", + ], + 'command' => "/usr/bin/add-apt-repository #{title}", + 'creates' => "/etc/apt/sources.list.d/#{filename}", + 'require' => ["File[/etc/apt/sources.list.d]", "Package[#{package}]"], + 'notify' => "Exec[apt_update]" + ) + } + end end end