X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Facceptance%2Fapt_ppa_spec.rb;h=b665c5cf477a84a5d74590163ebe7ae1d6a0dc35;hb=a68eca58a658e432fbfffcd91862134082ac7dc0;hp=c11da9123be2e2dcbc6ad5d77ef97c22f0c29775;hpb=2b9eb2949aa70d002b300dfa53d0cdc2e9cbe698;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/spec/acceptance/apt_ppa_spec.rb b/spec/acceptance/apt_ppa_spec.rb index c11da91..b665c5c 100644 --- a/spec/acceptance/apt_ppa_spec.rb +++ b/spec/acceptance/apt_ppa_spec.rb @@ -50,12 +50,51 @@ if fact('operatingsystem') == 'Ubuntu' end end + context 'ensure' do + context 'present' do + it 'works without failure' do + pp = <<-EOS + include '::apt' + apt::ppa { 'ppa:canonical-kernel-team/ppa': ensure => present } + EOS + + apply_manifest(pp, :catch_failures => true) + end + + describe 'contains the source file' do + it 'contains a kernel ppa source' do + shell('ls /etc/apt/sources.list.d/canonical-kernel-team-ppa-*', :acceptable_exit_codes => [0]) + end + end + end + end + + context 'ensure' do + context 'absent' do + it 'works without failure' do + pp = <<-EOS + include '::apt' + apt::ppa { 'ppa:canonical-kernel-team/ppa': ensure => absent } + EOS + + apply_manifest(pp, :catch_failures => true) + end + + describe 'doesnt contain the source file' do + it 'fails' do + shell('ls /etc/apt/sources.list.d/canonical-kernel-team-ppa-*', :acceptable_exit_codes => [2]) + end + end + end + end + context 'release' do context 'precise' do it 'works without failure' do pp = <<-EOS include '::apt' apt::ppa { 'ppa:canonical-kernel-team/ppa': + ensure => present, release => precise, } EOS @@ -76,6 +115,7 @@ if fact('operatingsystem') == 'Ubuntu' pp = <<-EOS include '::apt' apt::ppa { 'ppa:canonical-kernel-team/ppa': + ensure => present, release => precise, options => '-y', }