X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Fdefines%2Fppa_spec.rb;h=5080a876bb86b13adb86840d6c9c96cbee38a3ca;hb=ddd05418ae26c0c4b886d69b1aec23541098e502;hp=b7a2f6c0046cba98a205f2b6dd5ba004e8986cc1;hpb=fa86d8ed5052407f9279c308c2a9079599380bf8;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/spec/defines/ppa_spec.rb b/spec/defines/ppa_spec.rb index b7a2f6c..5080a87 100644 --- a/spec/defines/ppa_spec.rb +++ b/spec/defines/ppa_spec.rb @@ -16,12 +16,12 @@ describe 'apt::ppa' do } end - let(:title) { 'ppa:needs/such.substitution/wow' } + let(:title) { 'ppa:needs/such.substitution/wow+type' } it { is_expected.to_not contain_package('python-software-properties') } - it { is_expected.to contain_exec('add-apt-repository-ppa:needs/such.substitution/wow').that_notifies('Class[Apt::Update]').with({ + it { is_expected.to contain_exec('add-apt-repository-ppa:needs/such.substitution/wow+type').that_notifies('Class[Apt::Update]').with({ :environment => [], - :command => '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow', - :unless => '/usr/bin/test -s /etc/apt/sources.list.d/needs-such_substitution-wow-natty.list', + :command => '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow+type', + :unless => '/usr/bin/test -s /etc/apt/sources.list.d/needs-such_substitution-wow_type-natty.list', :user => 'root', :logoutput => 'on_failure', }) @@ -72,6 +72,46 @@ describe 'apt::ppa' do } end + describe 'package_manage => true, multiple ppas, MODULES-2873' do + let :pre_condition do + 'class { "apt": } + apt::ppa {"ppa:foo": + package_manage => true + }' + end + let :facts do + { + :lsbdistrelease => '11.04', + :lsbdistcodename => 'natty', + :operatingsystem => 'Ubuntu', + :osfamily => 'Debian', + :lsbdistid => 'Ubuntu', + :puppetversion => Puppet.version, + } + end + let :params do + { + :package_manage => true, + } + end + + let(:title) { 'ppa:bar' } + it { is_expected.to contain_package('python-software-properties') } + it { is_expected.to contain_exec('add-apt-repository-ppa:bar').that_notifies('Class[Apt::Update]').with({ + 'environment' => [], + 'command' => '/usr/bin/add-apt-repository -y ppa:bar', + 'unless' => '/usr/bin/test -s /etc/apt/sources.list.d/bar-natty.list', + 'user' => 'root', + 'logoutput' => 'on_failure', + }) + } + + it { is_expected.to contain_file('/etc/apt/sources.list.d/bar-natty.list').that_requires('Exec[add-apt-repository-ppa:bar]').with({ + 'ensure' => 'file', + }) + } + end + describe 'package_manage => false' do let :pre_condition do 'class { "apt": }'