X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Fdefines%2Fppa_spec.rb;h=b7a2f6c0046cba98a205f2b6dd5ba004e8986cc1;hb=caf5f7a6976004e80e48631687105ba329ec4366;hp=7903e470377410d2df8320148c066970bb331445;hpb=43ab92c4768b638edada41b801091af1a839dfba;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/spec/defines/ppa_spec.rb b/spec/defines/ppa_spec.rb index 7903e47..b7a2f6c 100644 --- a/spec/defines/ppa_spec.rb +++ b/spec/defines/ppa_spec.rb @@ -12,12 +12,13 @@ describe 'apt::ppa' do :operatingsystem => 'Ubuntu', :osfamily => 'Debian', :lsbdistid => 'Ubuntu', + :puppetversion => Puppet.version, } end let(:title) { 'ppa:needs/such.substitution/wow' } 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('Exec[apt_update]').with({ + it { is_expected.to contain_exec('add-apt-repository-ppa:needs/such.substitution/wow').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', @@ -50,12 +51,13 @@ describe 'apt::ppa' do :operatingsystem => 'Ubuntu', :osfamily => 'Debian', :lsbdistid => 'Ubuntu', + :puppetversion => Puppet.version, } end let(:title) { 'ppa:needs/such.substitution/wow' } it { is_expected.to contain_package('software-properties-common') } - it { is_expected.to contain_exec('add-apt-repository-ppa:needs/such.substitution/wow').that_notifies('Exec[apt_update]').with({ + it { is_expected.to contain_exec('add-apt-repository-ppa:needs/such.substitution/wow').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', @@ -81,6 +83,7 @@ describe 'apt::ppa' do :operatingsystem => 'Ubuntu', :osfamily => 'Debian', :lsbdistid => 'Ubuntu', + :puppetversion => Puppet.version, } end let :params do @@ -91,7 +94,7 @@ describe 'apt::ppa' do let(:title) { 'ppa:needs/such.substitution/wow' } 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('Exec[apt_update]').with({ + it { is_expected.to contain_exec('add-apt-repository-ppa:needs/such.substitution/wow').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', @@ -119,6 +122,7 @@ describe 'apt::ppa' do :operatingsystem => 'Ubuntu', :lsbdistid => 'Ubuntu', :osfamily => 'Debian', + :puppetversion => Puppet.version, } end let :params do @@ -131,7 +135,7 @@ describe 'apt::ppa' do let(:title) { 'ppa:foo' } it { is_expected.to compile.with_all_deps } it { is_expected.to contain_package('software-properties-common') } - it { is_expected.to contain_exec('add-apt-repository-ppa:foo').that_notifies('Exec[apt_update]').with({ + it { is_expected.to contain_exec('add-apt-repository-ppa:foo').that_notifies('Class[Apt::Update]').with({ :environment => [], :command => '/usr/bin/add-apt-repository ppa:foo', :unless => '/usr/bin/test -s /etc/apt/sources.list.d/foo-trusty.list', @@ -154,6 +158,7 @@ describe 'apt::ppa' do :operatingsystem => 'Ubuntu', :lsbdistid => 'Ubuntu', :osfamily => 'Debian', + :puppetversion => Puppet.version, } end let :params do @@ -164,7 +169,7 @@ describe 'apt::ppa' do end let(:title) { 'ppa:foo' } it { is_expected.to contain_package('software-properties-common') } - it { is_expected.to contain_exec('add-apt-repository-ppa:foo').that_notifies('Exec[apt_update]').with({ + it { is_expected.to contain_exec('add-apt-repository-ppa:foo').that_notifies('Class[Apt::Update]').with({ :environment => ['http_proxy=http://localhost:8080'], :command => '/usr/bin/add-apt-repository ppa:foo', :unless => '/usr/bin/test -s /etc/apt/sources.list.d/foo-trusty.list', @@ -187,6 +192,7 @@ describe 'apt::ppa' do :operatingsystem => 'Ubuntu', :lsbdistid => 'Ubuntu', :osfamily => 'Debian', + :puppetversion => Puppet.version, } end let :params do @@ -197,7 +203,7 @@ describe 'apt::ppa' do end let(:title) { 'ppa:foo' } it { is_expected.to contain_package('software-properties-common') } - it { is_expected.to contain_exec('add-apt-repository-ppa:foo').that_notifies('Exec[apt_update]').with({ + it { is_expected.to contain_exec('add-apt-repository-ppa:foo').that_notifies('Class[Apt::Update]').with({ :environment => ['http_proxy=http://localhost:8180'], :command => '/usr/bin/add-apt-repository ppa:foo', :unless => '/usr/bin/test -s /etc/apt/sources.list.d/foo-trusty.list', @@ -220,6 +226,7 @@ describe 'apt::ppa' do :operatingsystem => 'Ubuntu', :lsbdistid => 'Ubuntu', :osfamily => 'Debian', + :puppetversion => Puppet.version, } end let :params do @@ -230,7 +237,7 @@ describe 'apt::ppa' do end let(:title) { 'ppa:foo' } it { is_expected.to contain_package('software-properties-common') } - it { is_expected.to contain_exec('add-apt-repository-ppa:foo').that_notifies('Exec[apt_update]').with({ + it { is_expected.to contain_exec('add-apt-repository-ppa:foo').that_notifies('Class[Apt::Update]').with({ :environment => ['http_proxy=http://localhost:8180', 'https_proxy=https://localhost:8180'], :command => '/usr/bin/add-apt-repository ppa:foo', :unless => '/usr/bin/test -s /etc/apt/sources.list.d/foo-trusty.list', @@ -251,6 +258,7 @@ describe 'apt::ppa' do :operatingsystem => 'Ubuntu', :lsbdistid => 'Ubuntu', :osfamily => 'Debian', + :puppetversion => Puppet.version, } end let(:title) { 'ppa:foo' } @@ -259,7 +267,7 @@ describe 'apt::ppa' do :ensure => 'absent' } end - it { is_expected.to contain_file('/etc/apt/sources.list.d/foo-trusty.list').that_notifies('Exec[apt_update]').with({ + it { is_expected.to contain_file('/etc/apt/sources.list.d/foo-trusty.list').that_notifies('Class[Apt::Update]').with({ :ensure => 'absent', }) } @@ -274,12 +282,13 @@ describe 'apt::ppa' do :lsbdistid => 'Ubuntu', :osfamily => 'Debian', :lsbdistcodeanme => nil, + :puppetversion => Puppet.version, } end let(:title) { 'ppa:foo' } it do expect { - is_expected.to compile + subject.call }.to raise_error(Puppet::Error, /lsbdistcodename fact not available: release parameter required/) end end @@ -292,13 +301,14 @@ describe 'apt::ppa' do :operatingsystem => 'Debian', :lsbdistid => 'debian', :osfamily => 'Debian', + :puppetversion => Puppet.version, } end let(:title) { 'ppa:foo' } it do expect { - is_expected.to compile - }.to raise_error(Puppet::Error, /supported on Ubuntu and LinuxMint only/) + subject.call + }.to raise_error(Puppet::Error, /not currently supported on Debian/) end end end