2 describe 'apt::ppa', :type => :define do
3 ['ppa:dans_ppa', 'dans_ppa'].each do |t|
4 describe "with title #{t}" do
11 let :unless_statement do
13 /^[^#].*ppa.*#{$1}.*$/
18 it { should contain_exec("add-apt-repository-#{t}").with(
19 'command' => "/usr/bin/add-apt-repository #{t}",
20 'notify' => "Exec[apt-update-#{t}]"
23 it { should contain_exec("add-apt-repository-#{t}").with({"unless" => unless_statement}) }
24 it { should contain_exec("apt-update-#{t}").with(
25 'command' => '/usr/bin/aptitude update',
29 it { should contain_exec("apt-update-#{t}").without_unless }
33 describe "without Class[apt] should raise a Puppet::Error" do
35 it { expect { should contain_apt__ppa(title) }.to raise_error(Puppet::Error) }