Update to pdk-templates and puppet-module-gems 1.0.0
[puppet-modules/puppetlabs-apt.git] / spec / defines / ppa_spec.rb
index 984c3e872ca6ccf5b34b7d42b1fb5020b2205b56..ba234fd8059d108e5326901aa0c3973d14eaba4c 100644 (file)
@@ -13,7 +13,6 @@ describe 'apt::ppa' do
         operatingsystem: 'Ubuntu',
         osfamily: 'Debian',
         lsbdistid: 'Ubuntu',
-        puppetversion: Puppet.version,
       }
     end
 
@@ -23,7 +22,7 @@ describe 'apt::ppa' do
     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+type || (rm /etc/apt/sources.list.d/needs-such_substitution-wow_type-trusty.list && false)', # rubocop:disable Metrics/LineLength
-                                                                                                                                      unless: '/usr/bin/test -f /etc/apt/sources.list.d/needs-such_substitution-wow_type-trusty.list', # rubocop:disable Metrics/LineLength
+                                                                                                                                      unless: '/usr/bin/test -f /etc/apt/sources.list.d/needs-such_substitution-wow_type-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/needs-such_substitution-wow_type.gpg', # rubocop:disable Metrics/LineLength
                                                                                                                                       user: 'root',
                                                                                                                                       logoutput: 'on_failure')
     }
@@ -38,7 +37,6 @@ describe 'apt::ppa' do
         operatingsystem: 'Ubuntu',
         osfamily: 'Debian',
         lsbdistid: 'Ubuntu',
-        puppetversion: Puppet.version,
       }
     end
 
@@ -47,7 +45,7 @@ describe 'apt::ppa' do
     it {
       is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with(environment: [],
                                                                                                               command: '/usr/bin/add-apt-repository -y ppa:user/foo || (rm /etc/apt/sources.list.d/user-ubuntu-foo-wily.list && false)', # rubocop:disable Metrics/LineLength
-                                                                                                              unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-ubuntu-foo-wily.list',
+                                                                                                              unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-ubuntu-foo-wily.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/user_ubuntu_foo.gpg', # rubocop:disable Metrics/LineLength
                                                                                                               user: 'root',
                                                                                                               logoutput: 'on_failure')
     }
@@ -71,7 +69,6 @@ describe 'apt::ppa' do
         operatingsystem: 'Ubuntu',
         osfamily: 'Debian',
         lsbdistid: 'Ubuntu',
-        puppetversion: Puppet.version,
       }
     end
 
@@ -81,7 +78,7 @@ describe 'apt::ppa' do
     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 || (rm /etc/apt/sources.list.d/needs-such_substitution-wow-trusty.list && false)', # rubocop:disable Metrics/LineLength
-                                                                                                                                 'unless'      => '/usr/bin/test -f /etc/apt/sources.list.d/needs-such_substitution-wow-trusty.list', # rubocop:disable Metrics/LineLength
+                                                                                                                                 'unless'      => '/usr/bin/test -f /etc/apt/sources.list.d/needs-such_substitution-wow-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/needs-such_substitution-wow.gpg', # rubocop:disable Metrics/LineLength
                                                                                                                                  'user'        => 'root',
                                                                                                                                  'logoutput'   => 'on_failure')
     }
@@ -103,7 +100,6 @@ describe 'apt::ppa' do
         operatingsystem: 'Ubuntu',
         osfamily: 'Debian',
         lsbdistid: 'Ubuntu',
-        puppetversion: Puppet.version,
       }
     end
     let :params do
@@ -118,7 +114,7 @@ describe 'apt::ppa' do
     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 || (rm /etc/apt/sources.list.d/needs-such_substitution-wow-trusty.list && false)', # rubocop:disable Metrics/LineLength
-                                                                                                                                 'unless'      => '/usr/bin/test -f /etc/apt/sources.list.d/needs-such_substitution-wow-trusty.list', # rubocop:disable Metrics/LineLength
+                                                                                                                                 'unless'      => '/usr/bin/test -f /etc/apt/sources.list.d/needs-such_substitution-wow-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/needs-such_substitution-wow.gpg', # rubocop:disable Metrics/LineLength
                                                                                                                                  'user'        => 'root',
                                                                                                                                  'logoutput'   => 'on_failure')
     }
@@ -142,7 +138,6 @@ describe 'apt::ppa' do
         operatingsystem: 'Ubuntu',
         lsbdistid: 'Ubuntu',
         osfamily: 'Debian',
-        puppetversion: Puppet.version,
       }
     end
     let :params do
@@ -159,7 +154,7 @@ describe 'apt::ppa' do
     it {
       is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with(environment: [],
                                                                                                               command: '/usr/bin/add-apt-repository  ppa:user/foo || (rm /etc/apt/sources.list.d/user-foo-trusty.list && false)', # rubocop:disable Metrics/LineLength
-                                                                                                              unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list',
+                                                                                                              unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/user-foo.gpg', # rubocop:disable Metrics/LineLength
                                                                                                               user: 'root',
                                                                                                               logoutput: 'on_failure')
     }
@@ -179,7 +174,6 @@ describe 'apt::ppa' do
         operatingsystem: 'Ubuntu',
         lsbdistid: 'Ubuntu',
         osfamily: 'Debian',
-        puppetversion: Puppet.version,
       }
     end
     let :params do
@@ -194,7 +188,7 @@ describe 'apt::ppa' do
     it {
       is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with(environment: ['http_proxy=http://localhost:8080'],
                                                                                                               command: '/usr/bin/add-apt-repository  ppa:user/foo || (rm /etc/apt/sources.list.d/user-foo-trusty.list && false)', # rubocop:disable Metrics/LineLength
-                                                                                                              unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list',
+                                                                                                              unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/user-foo.gpg', # rubocop:disable Metrics/LineLength
                                                                                                               user: 'root',
                                                                                                               logoutput: 'on_failure')
     }
@@ -214,7 +208,6 @@ describe 'apt::ppa' do
         operatingsystem: 'Ubuntu',
         lsbdistid: 'Ubuntu',
         osfamily: 'Debian',
-        puppetversion: Puppet.version,
       }
     end
     let :params do
@@ -229,7 +222,7 @@ describe 'apt::ppa' do
     it {
       is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with(environment: ['http_proxy=http://localhost:8180'],
                                                                                                               command: '/usr/bin/add-apt-repository  ppa:user/foo || (rm /etc/apt/sources.list.d/user-foo-trusty.list && false)', # rubocop:disable Metrics/LineLength
-                                                                                                              unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list',
+                                                                                                              unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/user-foo.gpg', # rubocop:disable Metrics/LineLength
                                                                                                               user: 'root',
                                                                                                               logoutput: 'on_failure')
     }
@@ -249,7 +242,6 @@ describe 'apt::ppa' do
         operatingsystem: 'Ubuntu',
         lsbdistid: 'Ubuntu',
         osfamily: 'Debian',
-        puppetversion: Puppet.version,
       }
     end
     let :params do
@@ -264,7 +256,7 @@ describe 'apt::ppa' do
     it {
       is_expected.to contain_exec('add-apt-repository-ppa:user/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:user/foo || (rm /etc/apt/sources.list.d/user-foo-trusty.list && false)', # rubocop:disable Metrics/LineLength
-                                                                                                              unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list',
+                                                                                                              unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/user-foo.gpg', # rubocop:disable Metrics/LineLength
                                                                                                               user: 'root',
                                                                                                               logoutput: 'on_failure')
     }
@@ -282,7 +274,6 @@ describe 'apt::ppa' do
         operatingsystem: 'Ubuntu',
         lsbdistid: 'Ubuntu',
         osfamily: 'Debian',
-        puppetversion: Puppet.version,
       }
     end
     let(:title) { 'ppa:user/foo' }
@@ -307,7 +298,6 @@ describe 'apt::ppa' do
           lsbdistid: 'Ubuntu',
           osfamily: 'Debian',
           lsbdistcodeanme: nil,
-          puppetversion: Puppet.version,
         }
       end
       let(:title) { 'ppa:user/foo' }
@@ -326,7 +316,6 @@ describe 'apt::ppa' do
           operatingsystem: 'Debian',
           lsbdistid: 'debian',
           osfamily: 'Debian',
-          puppetversion: Puppet.version,
         }
       end
       let(:title) { 'ppa:user/foo' }