(CONT-773) Rubocop Auto Fixes 6-10
authordavid22swan <david.swan@puppet.com>
Fri, 21 Apr 2023 12:44:09 +0000 (13:44 +0100)
committerdavid22swan <david.swan@puppet.com>
Fri, 21 Apr 2023 12:44:09 +0000 (13:44 +0100)
- Lint/SymbolConversion
- RSpec/BeNil
- RSpec/EmptyLineAfterExample
- RSpec/EmptyLineAfterExampleGroup
- RSpec/EmptyLineAfterHook

24 files changed:
.rubocop_todo.yml
spec/acceptance/apt_key_provider_spec.rb
spec/acceptance/apt_spec.rb
spec/acceptance/init_task_spec.rb
spec/classes/apt_backports_spec.rb
spec/classes/apt_spec.rb
spec/classes/apt_update_spec.rb
spec/defines/key_compat_spec.rb
spec/defines/key_spec.rb
spec/defines/pin_spec.rb
spec/defines/ppa_spec.rb
spec/defines/source_spec.rb
spec/unit/facter/apt_dist_has_updates_spec.rb
spec/unit/facter/apt_dist_package_security_updates_spec.rb
spec/unit/facter/apt_dist_package_updates_spec.rb
spec/unit/facter/apt_dist_security_updates_spec.rb
spec/unit/facter/apt_dist_updates_spec.rb
spec/unit/facter/apt_has_updates_spec.rb
spec/unit/facter/apt_package_security_updates_spec.rb
spec/unit/facter/apt_package_updates_spec.rb
spec/unit/facter/apt_reboot_required_spec.rb
spec/unit/facter/apt_security_updates_spec.rb
spec/unit/facter/apt_updates_spec.rb
spec/unit/puppet/provider/apt_key_spec.rb

index 31aae81836d0719859dba2d2521d29f3258d96cc..5ae1290b5aa48272274b13715919d4fb34217fcf 100644 (file)
@@ -21,14 +21,6 @@ Lint/ConstantDefinitionInBlock:
     - 'spec/defines/source_compat_spec.rb'
     - 'spec/defines/source_spec.rb'
 
-# Offense count: 6
-# This cop supports safe autocorrection (--autocorrect).
-# Configuration parameters: EnforcedStyle.
-# SupportedStyles: strict, consistent
-Lint/SymbolConversion:
-  Exclude:
-    - 'spec/classes/apt_update_spec.rb'
-
 # Offense count: 6
 # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
 Metrics/AbcSize:
@@ -68,21 +60,6 @@ RSpec/BeEq:
     - 'spec/unit/facter/apt_reboot_required_spec.rb'
     - 'spec/unit/puppet/type/apt_key_spec.rb'
 
-# Offense count: 8
-# This cop supports safe autocorrection (--autocorrect).
-# Configuration parameters: EnforcedStyle.
-# SupportedStyles: be, be_nil
-RSpec/BeNil:
-  Exclude:
-    - 'spec/unit/facter/apt_dist_package_security_updates_spec.rb'
-    - 'spec/unit/facter/apt_dist_package_updates_spec.rb'
-    - 'spec/unit/facter/apt_dist_security_updates_spec.rb'
-    - 'spec/unit/facter/apt_dist_updates_spec.rb'
-    - 'spec/unit/facter/apt_package_security_updates_spec.rb'
-    - 'spec/unit/facter/apt_package_updates_spec.rb'
-    - 'spec/unit/facter/apt_security_updates_spec.rb'
-    - 'spec/unit/facter/apt_updates_spec.rb'
-
 # Offense count: 6
 # Configuration parameters: Prefixes, AllowedPatterns.
 # Prefixes: when, with, without
@@ -97,52 +74,6 @@ RSpec/ContextWording:
 RSpec/DescribeClass:
   Enabled: false
 
-# Offense count: 23
-# This cop supports safe autocorrection (--autocorrect).
-# Configuration parameters: AllowConsecutiveOneLiners.
-RSpec/EmptyLineAfterExample:
-  Exclude:
-    - 'spec/acceptance/apt_key_provider_spec.rb'
-    - 'spec/acceptance/apt_spec.rb'
-    - 'spec/classes/apt_spec.rb'
-    - 'spec/defines/key_compat_spec.rb'
-    - 'spec/defines/key_spec.rb'
-    - 'spec/defines/pin_spec.rb'
-    - 'spec/defines/ppa_spec.rb'
-    - 'spec/defines/source_spec.rb'
-
-# Offense count: 39
-# This cop supports safe autocorrection (--autocorrect).
-RSpec/EmptyLineAfterExampleGroup:
-  Exclude:
-    - 'spec/acceptance/apt_key_provider_spec.rb'
-    - 'spec/acceptance/init_task_spec.rb'
-    - 'spec/classes/apt_backports_spec.rb'
-    - 'spec/classes/apt_spec.rb'
-    - 'spec/classes/apt_update_spec.rb'
-    - 'spec/defines/key_compat_spec.rb'
-    - 'spec/defines/key_spec.rb'
-    - 'spec/defines/source_spec.rb'
-
-# Offense count: 24
-# This cop supports safe autocorrection (--autocorrect).
-# Configuration parameters: AllowConsecutiveOneLiners.
-RSpec/EmptyLineAfterHook:
-  Exclude:
-    - 'spec/acceptance/apt_key_provider_spec.rb'
-    - 'spec/unit/facter/apt_dist_has_updates_spec.rb'
-    - 'spec/unit/facter/apt_dist_package_security_updates_spec.rb'
-    - 'spec/unit/facter/apt_dist_package_updates_spec.rb'
-    - 'spec/unit/facter/apt_dist_security_updates_spec.rb'
-    - 'spec/unit/facter/apt_dist_updates_spec.rb'
-    - 'spec/unit/facter/apt_has_updates_spec.rb'
-    - 'spec/unit/facter/apt_package_security_updates_spec.rb'
-    - 'spec/unit/facter/apt_package_updates_spec.rb'
-    - 'spec/unit/facter/apt_reboot_required_spec.rb'
-    - 'spec/unit/facter/apt_security_updates_spec.rb'
-    - 'spec/unit/facter/apt_updates_spec.rb'
-    - 'spec/unit/puppet/provider/apt_key_spec.rb'
-
 # Offense count: 13
 # Configuration parameters: CountAsOne.
 RSpec/ExampleLength:
index aa763405a37eb71eac736f94ce5ef7bf8eb525ae..4ca9dba219a9a4d9213519113a5711683e3630d3 100644 (file)
@@ -669,6 +669,7 @@ describe 'apt_key' do
     it 'add an apt_key resource' do
       apply_manifest_twice(ensure_present_pp)
     end
+
     it 'remove the apt_key resource' do
       apply_manifest_twice(ensure_absent_pp)
     end
@@ -855,6 +856,7 @@ describe 'apt_key' do
       after(:each) do
         run_shell('rm /tmp/fake-key.gpg')
       end
+
       it 'fails' do
         apply_manifest(path_bogus_content_pp, expect_failures: true) do |r|
           expect(r.stderr).to match(%r{no valid OpenPGP data found})
@@ -897,6 +899,7 @@ describe 'apt_key' do
       apply_manifest(refresh_del_key_pp)
       apply_manifest(refresh_pp, catch_failures: true)
     end
+
     context 'when refresh => true' do
       it 'updates an expired key' do
         apply_manifest(refresh_true_pp)
@@ -904,6 +907,7 @@ describe 'apt_key' do
         run_shell(PUPPETLABS_EXP_CHECK_COMMAND.to_s)
       end
     end
+
     context 'when refresh => false' do
       it 'does not replace an expired key' do
         apply_manifest(refresh_false_pp)
index 35277bb5912116d54994ebcc3fd5e6013e0a5318..d726c342a263702f536fbfc76e5efb0d7e039abf 100644 (file)
@@ -45,6 +45,7 @@ describe 'apt class' do
         apply_manifest(everything_everything_pp, catch_failures: true)
       end
     end
+
     it 'stills work' do
       run_shell('apt-get update')
       run_shell('apt-get -y --force-yes upgrade')
index 02b3f34dfd691b2862c7d97d2e36a6f79552e944..7a21a43854ee76012dbbc8ecea9e61ef657adbd9 100644 (file)
@@ -10,18 +10,21 @@ describe 'apt tasks' do
       expect(result.stdout).to contain(%r{Reading package lists})
     end
   end
+
   describe 'upgrade' do
     it 'upgrades packages' do
       result = run_bolt_task('apt', 'action' => 'upgrade')
       expect(result.stdout).to contain(%r{\d+ upgraded, \d+ newly installed, \d+ to remove and \d+ not upgraded})
     end
   end
+
   describe 'dist-upgrade' do
     it 'dist-upgrades packages' do
       result = run_bolt_task('apt', 'action' => 'dist-upgrade')
       expect(result.stdout).to contain(%r{\d+ upgraded, \d+ newly installed, \d+ to remove and \d+ not upgraded})
     end
   end
+
   describe 'autoremove' do
     it 'autoremoves obsolete packages' do
       result = run_bolt_task('apt', 'action' => 'autoremove')
index 6f6d5309217c2129edd665dd24fdbae098fa80c5..2ae8429478775dc4c55f2eee0e5089365710fe09 100644 (file)
@@ -31,6 +31,7 @@ describe 'apt::backports', type: :class do
                                                              pin: { 'priority' => 200, 'release' => 'stretch-backports' })
       }
     end
+
     context 'with defaults on ubuntu' do
       let(:facts) do
         {
@@ -57,6 +58,7 @@ describe 'apt::backports', type: :class do
                                                              pin: { 'priority' => 200, 'release' => 'bionac-backports' })
       }
     end
+
     context 'with everything set' do
       let(:facts) do
         {
@@ -92,6 +94,7 @@ describe 'apt::backports', type: :class do
                                                              pin: { 'priority' => 90, 'release' => 'vivid' })
       }
     end
+
     context 'when set things with hashes' do
       let(:facts) do
         {
@@ -126,6 +129,7 @@ describe 'apt::backports', type: :class do
       }
     end
   end
+
   describe 'mint tests' do
     let(:facts) do
       {
@@ -162,6 +166,7 @@ describe 'apt::backports', type: :class do
                                                              pin: { 'priority' => 200, 'release' => 'trusty-backports' })
       }
     end
+
     context 'with missing location' do
       let(:params) do
         {
@@ -175,6 +180,7 @@ describe 'apt::backports', type: :class do
         is_expected.to raise_error(Puppet::Error, %r{If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key})
       end
     end
+
     context 'with missing release' do
       let(:params) do
         {
@@ -188,6 +194,7 @@ describe 'apt::backports', type: :class do
         is_expected.to raise_error(Puppet::Error, %r{If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key})
       end
     end
+
     context 'with missing repos' do
       let(:params) do
         {
@@ -201,6 +208,7 @@ describe 'apt::backports', type: :class do
         is_expected.to raise_error(Puppet::Error, %r{If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key})
       end
     end
+
     context 'with missing key' do
       let(:params) do
         {
@@ -215,6 +223,7 @@ describe 'apt::backports', type: :class do
       end
     end
   end
+
   describe 'validation' do
     let(:facts) do
       {
@@ -244,6 +253,7 @@ describe 'apt::backports', type: :class do
         is_expected.to raise_error(Puppet::Error, %r{expects a})
       end
     end
+
     context 'with invalid release' do
       let(:params) do
         {
@@ -255,6 +265,7 @@ describe 'apt::backports', type: :class do
         is_expected.to raise_error(Puppet::Error, %r{expects a})
       end
     end
+
     context 'with invalid repos' do
       let(:params) do
         {
@@ -266,6 +277,7 @@ describe 'apt::backports', type: :class do
         is_expected.to raise_error(Puppet::Error, %r{expects a})
       end
     end
+
     context 'with invalid key' do
       let(:params) do
         {
@@ -277,6 +289,7 @@ describe 'apt::backports', type: :class do
         is_expected.to raise_error(Puppet::Error, %r{expects a})
       end
     end
+
     context 'with invalid pin' do
       let(:params) do
         {
index b7ef6b5d1c43b21078cad6bb0bc7004cf587fdc1..afd7797049bede5b7e25c2691aab66a8d0c0434b 100644 (file)
@@ -214,6 +214,7 @@ describe 'apt' do
           %r{Acquire::https::proxy "https://localhost:8080/";},
         )
       }
+
       it {
         is_expected.to contain_apt__setting('conf-proxy').with(priority: '01').with_content(
           %r{Acquire::http::proxy "http://localhost:8080/";},
@@ -232,6 +233,7 @@ describe 'apt' do
       }
     end
   end
+
   context 'with lots of non-defaults' do
     let :params do
       {
index 6ab9534c46b346538ff6a956c8be412dc7b6d509..5a73eb45ec65736dabe20c47113142a560f7edc2 100644 (file)
@@ -24,7 +24,7 @@ describe 'apt::update', type: :class do
                 id: 'Debian',
               },
             },
-            'apt_update_last_success': factval,
+            apt_update_last_success: factval,
           }
         end
         let(:pre_condition) do
@@ -61,6 +61,7 @@ describe 'apt::update', type: :class do
         is_expected.to contain_exec('apt_update').with('refreshonly' => false)
       end
     end
+
     context 'and Exec[apt_update] refreshonly is overridden to true and has recent run' do
       let(:facts) do
         {
@@ -76,7 +77,7 @@ describe 'apt::update', type: :class do
               id: 'Debian',
             },
           },
-          'apt_update_last_success': Time.now.to_i,
+          apt_update_last_success: Time.now.to_i,
         }
       end
       let(:pre_condition) do
@@ -92,6 +93,7 @@ describe 'apt::update', type: :class do
       end
     end
   end
+
   context "when apt::update['frequency']='reluctantly'" do
     {
       'a recent run' => Time.now.to_i,
@@ -113,7 +115,7 @@ describe 'apt::update', type: :class do
                 id: 'Debian',
               },
             },
-            'apt_update_last_success': factval,
+            apt_update_last_success: factval,
           }
         end
         let(:pre_condition) { "class{ '::apt': update => {'frequency' => 'reluctantly' },}" }
@@ -149,6 +151,7 @@ describe 'apt::update', type: :class do
       end
     end
   end
+
   ['daily', 'weekly'].each do |update_frequency|
     context "when apt::update['frequency'] has the value of #{update_frequency}" do
       { 'we are due for a run' => 1_406_660_561, 'the update-success-stamp file does not exist' => -1 }.each_pair do |desc, factval|
@@ -167,7 +170,7 @@ describe 'apt::update', type: :class do
                   id: 'Debian',
                 },
               },
-              'apt_update_last_success': factval,
+              apt_update_last_success: factval,
             }
           end
           let(:pre_condition) { "class{ '::apt': update => {'frequency' => '#{update_frequency}',} }" }
@@ -193,7 +196,7 @@ describe 'apt::update', type: :class do
                 id: 'Debian',
               },
             },
-            'apt_update_last_success': Time.now.to_i,
+            apt_update_last_success: Time.now.to_i,
           }
         end
         let(:pre_condition) { "class{ '::apt': update => {'frequency' => '#{update_frequency}',} }" }
@@ -203,6 +206,7 @@ describe 'apt::update', type: :class do
           is_expected.to contain_exec('apt_update').with('refreshonly' => true)
         end
       end
+
       context 'when $apt_update_last_success is nil' do
         let(:facts) do
           {
@@ -218,7 +222,7 @@ describe 'apt::update', type: :class do
                 id: 'Debian',
               },
             },
-            'apt_update_last_success': nil,
+            apt_update_last_success: nil,
           }
         end
         let(:pre_condition) { "class{ '::apt': update => {'frequency' => '#{update_frequency}',} }" }
index 2fb7e656382f261561f22f363d2aca5a40d96900..ab305a99d37dc3adb9201802f727df40a1a4bfaa 100644 (file)
@@ -57,6 +57,7 @@ describe 'apt::key', type: :define do
                                                    server: 'keyserver.ubuntu.com',
                                                    content: nil)
       }
+
       it 'contains the apt_key present anchor' do
         is_expected.to contain_anchor("apt_key #{title} present")
       end
@@ -80,6 +81,7 @@ describe 'apt::key', type: :define do
                                                    server: 'keyserver.ubuntu.com',
                                                    content: nil)
       end
+
       it 'contains the apt_key present anchor' do
         is_expected.to contain_anchor("apt_key #{GPG_KEY_ID} present")
       end
@@ -99,6 +101,7 @@ describe 'apt::key', type: :define do
                                                    server: 'keyserver.ubuntu.com',
                                                    content: nil)
       end
+
       it 'contains the apt_key absent anchor' do
         is_expected.to contain_anchor("apt_key #{title} absent")
       end
@@ -117,6 +120,7 @@ describe 'apt::key', type: :define do
       it 'contains the apt_key' do
         is_expected.to contain_apt_key(title).with(contains_apt_key_example(title))
       end
+
       it 'contains the apt_key present anchor' do
         is_expected.to contain_anchor("apt_key #{title} present")
       end
@@ -147,6 +151,7 @@ describe 'apt::key', type: :define do
                                                    server: 'hkp://pgp.mit.edu')
       end
     end
+
     context 'with url and port number' do
       let :params do
         {
@@ -197,6 +202,7 @@ describe 'apt::key', type: :define do
         is_expected.to raise_error(%r{expects a match})
       end
     end
+
     context 'when url character limit is exceeded' do
       let :params do
         {
@@ -208,6 +214,7 @@ describe 'apt::key', type: :define do
         is_expected.to raise_error(%r{expects a match})
       end
     end
+
     context 'with incorrect port number url' do
       let :params do
         {
@@ -219,6 +226,7 @@ describe 'apt::key', type: :define do
         is_expected.to raise_error(%r{expects a match})
       end
     end
+
     context 'with incorrect protocol for  url' do
       let :params do
         {
@@ -230,6 +238,7 @@ describe 'apt::key', type: :define do
         is_expected.to raise_error(%r{expects a match})
       end
     end
+
     context 'with missing port number url' do
       let :params do
         {
@@ -241,6 +250,7 @@ describe 'apt::key', type: :define do
         is_expected.to raise_error(%r{expects a match})
       end
     end
+
     context 'with url ending with a dot' do
       let :params do
         {
@@ -252,6 +262,7 @@ describe 'apt::key', type: :define do
         is_expected.to raise_error(%r{expects a match})
       end
     end
+
     context 'with url begin with a dash' do
       let(:params) do
         {
@@ -263,6 +274,7 @@ describe 'apt::key', type: :define do
         is_expected.to raise_error(%r{expects a match})
       end
     end
+
     context 'with invalid key' do
       let :title do
         'Out of rum. Why? Why are we out of rum?'
index 8c8d503f6c42a1cd2a8e735d686a4dc9c0dc55f3..956c9b68dd896eaa6ad216e818b95a32b750edf4 100644 (file)
@@ -70,6 +70,7 @@ describe 'apt::key' do
       it 'contains the apt_key' do
         is_expected.to contain_apt_key(title).with(default_apt_key_example(title))
       end
+
       it 'contains the apt_key present anchor' do
         is_expected.to contain_anchor("apt_key #{title} present")
       end
@@ -89,6 +90,7 @@ describe 'apt::key' do
       it 'contains the apt_key' do
         is_expected.to contain_apt_key(title).with(title_key_example)
       end
+
       it 'contains the apt_key present anchor' do
         is_expected.to contain_anchor("apt_key #{GPG_KEY_ID} present")
       end
@@ -104,6 +106,7 @@ describe 'apt::key' do
       it 'contains the apt_key' do
         is_expected.to contain_apt_key(title).with(absent_apt_key(title))
       end
+
       it 'contains the apt_key absent anchor' do
         is_expected.to contain_anchor("apt_key #{title} absent")
       end
@@ -137,6 +140,7 @@ describe 'apt::key' do
       it 'contains the apt_key' do
         is_expected.to contain_apt_key(title).with(bunch_things_apt_key_example(title, params))
       end
+
       it 'contains the apt_key present anchor' do
         is_expected.to contain_anchor("apt_key #{title} present")
       end
@@ -167,6 +171,7 @@ describe 'apt::key' do
                                                    server: 'hkp://pgp.mit.edu')
       end
     end
+
     context 'when url with port number' do
       let :params do
         {
@@ -217,6 +222,7 @@ describe 'apt::key' do
         is_expected.to raise_error(%r{expects a match})
       end
     end
+
     context 'when character url exceeded' do
       let :params do
         {
@@ -228,6 +234,7 @@ describe 'apt::key' do
         is_expected.to raise_error(%r{expects a match})
       end
     end
+
     context 'with incorrect port number url' do
       let :params do
         {
@@ -239,6 +246,7 @@ describe 'apt::key' do
         is_expected.to raise_error(%r{expects a match})
       end
     end
+
     context 'with incorrect protocol for url' do
       let :params do
         {
@@ -250,6 +258,7 @@ describe 'apt::key' do
         is_expected.to raise_error(%r{expects a match})
       end
     end
+
     context 'with missing port number url' do
       let :params do
         {
@@ -261,6 +270,7 @@ describe 'apt::key' do
         is_expected.to raise_error(%r{expects a match})
       end
     end
+
     context 'with url ending with a dot' do
       let :params do
         {
@@ -272,6 +282,7 @@ describe 'apt::key' do
         is_expected.to raise_error(%r{expects a match})
       end
     end
+
     context 'when url begins with a dash' do
       let(:params) do
         {
@@ -283,6 +294,7 @@ describe 'apt::key' do
         is_expected.to raise_error(%r{expects a match})
       end
     end
+
     context 'with invalid key' do
       let :title do
         'Out of rum. Why? Why are we out of rum?'
@@ -365,6 +377,7 @@ describe 'apt::key' do
         is_expected.to contain_apt__key('duplicate').with(id: title,
                                                           ensure: 'present')
       end
+
       it 'contains two apt::key resource - title' do
         is_expected.to contain_apt__key(title).with(id: title,
                                                     ensure: 'present')
@@ -373,6 +386,7 @@ describe 'apt::key' do
       it 'contains only a single apt_key - duplicate' do
         is_expected.to contain_apt_key('duplicate').with(default_apt_key_example(title))
       end
+
       it 'contains only a single apt_key - no title' do
         is_expected.not_to contain_apt_key(title)
       end
index f22d92ac5a28dc5248ad6eaaf8552cff1e768a8e..8b30a4c770d9bc620b2e4a865f32487c70dfed54 100644 (file)
@@ -65,6 +65,7 @@ describe 'apt::pin', type: :define do
     end
 
     it { is_expected.to contain_apt__setting('pref-my_pin').with_content(%r{Explanation: foo\nPackage: \*\nPin: release a=1, n=bar, v=2, c=baz, o=foobar, l=foobaz\nPin-Priority: 10\n}) }
+
     it {
       is_expected.to contain_apt__setting('pref-my_pin').with('priority' => 99)
     }
index 00424dccb75f7a3da9710a15e951bea36051a3c9..4732350e84d79ffc92327cb77adc723e668210e6 100644 (file)
@@ -37,6 +37,7 @@ describe 'apt::ppa' do
     let(:title) { 'ppa:needs/substitution' }
 
     it { is_expected.not_to contain_package('python-software-properties') }
+
     it {
       is_expected.to contain_exec('add-apt-repository-ppa:needs/substitution')
         .that_notifies('Class[Apt::Update]')
@@ -168,6 +169,7 @@ describe 'apt::ppa' do
     let(:title) { 'ppa:needs/substitution' }
 
     it { is_expected.to contain_package('software-properties-common') }
+
     it {
       is_expected.to contain_exec('add-apt-repository-ppa:needs/substitution')
         .that_notifies('Class[Apt::Update]')
@@ -207,6 +209,7 @@ describe 'apt::ppa' do
     let(:title) { 'ppa:needs/substitution' }
 
     it { is_expected.not_to contain_package('python-software-properties') }
+
     it {
       is_expected.to contain_exec('add-apt-repository-ppa:needs/substitution')
         .that_notifies('Class[Apt::Update]')
@@ -250,6 +253,7 @@ describe 'apt::ppa' do
 
     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:user/foo')
         .that_notifies('Class[Apt::Update]')
@@ -291,6 +295,7 @@ describe 'apt::ppa' do
     let(:title) { 'ppa:user/foo' }
 
     it { is_expected.to contain_package('software-properties-common') }
+
     it {
       is_expected.to contain_exec('add-apt-repository-ppa:user/foo')
         .that_notifies('Class[Apt::Update]')
@@ -332,6 +337,7 @@ describe 'apt::ppa' do
     let(:title) { 'ppa:user/foo' }
 
     it { is_expected.to contain_package('software-properties-common') }
+
     it {
       is_expected.to contain_exec('add-apt-repository-ppa:user/foo')
         .that_notifies('Class[Apt::Update]')
@@ -373,6 +379,7 @@ describe 'apt::ppa' do
     let(:title) { 'ppa:user/foo' }
 
     it { is_expected.to contain_package('software-properties-common') }
+
     it {
       is_expected.to contain_exec('add-apt-repository-ppa:user/foo')
         .that_notifies('Class[Apt::Update]')
index e5df79febc3f21a3135dc39e6ba96912c11c6b62..b2c09891c111c05d91340558ec3a13cf7d7b1791 100644 (file)
@@ -36,6 +36,7 @@ describe 'apt::source' do
         is_expected.to raise_error(Puppet::Error, %r{source entry without specifying a location})
       end
     end
+
     context 'with location' do
       let(:params) { { location: 'hello.there' } }
 
@@ -372,6 +373,7 @@ describe 'apt::source' do
     it {
       is_expected.to contain_apt__setting('list-my_source').with(ensure: 'present').without_content(%r{deb-src hello.there wheezy main\n})
     }
+
     it { is_expected.to contain_apt__setting('list-my_source').without_content(%r{deb hello.there wheezy main\n}) }
   end
 
@@ -386,6 +388,7 @@ describe 'apt::source' do
     it {
       is_expected.to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(%r{deb-src hello.there stretch main\n})
     }
+
     it { is_expected.to contain_apt__setting('list-my_source').without_content(%r{deb hello.there stretch main\n}) }
   end
 
index 3ed4f3b213ed96a4f525239739ea7a8af9e2f2c3..b5b05b6f054705c7ccc4dcadaa6c0b3a743a9d1a 100644 (file)
@@ -11,6 +11,7 @@ describe 'apt_has_dist_updates fact' do
     before(:each) do
       allow(Facter.fact(:osfamily)).to receive(:value).once.and_return('Redhat')
     end
+
     it { is_expected.to be_nil }
   end
 
@@ -20,6 +21,7 @@ describe 'apt_has_dist_updates fact' do
       allow(File).to receive(:executable?) # Stub all other calls
       allow(File).to receive(:executable?).with('/usr/bin/apt-get').and_return(false)
     end
+
     it { is_expected.to be_nil }
   end
 
@@ -36,6 +38,7 @@ describe 'apt_has_dist_updates fact' do
                    "Conf planet.rb (22-2~bpo8+1 Debian Backports:stretch-backports [all])\n"
       allow(Facter::Core::Execution).to receive(:execute).with('/usr/bin/apt-get -s -o Debug::NoLocking=true dist-upgrade 2>&1').and_return(apt_output)
     end
+
     it { is_expected.to be true }
   end
 end
index f16ff526577cc20472b797071951dbc178260d9a..1e8aeb8a58d6772740b840d53a23f3350d153c38 100644 (file)
@@ -11,7 +11,8 @@ describe 'apt_package_security_dist_updates fact' do
     before(:each) do
       allow(Facter.fact(:apt_has_dist_updates)).to receive(:value).and_return(false)
     end
-    it { is_expected.to be nil }
+
+    it { is_expected.to be_nil }
   end
 
   describe 'when apt has updates' do
index a27d607bab66c2d53283769c457c12cd8bcfd67c..43e2d7e7d9adfb8c1f0472992d17fd3406aed95d 100644 (file)
@@ -11,7 +11,8 @@ describe 'apt_package_dist_updates fact' do
     before(:each) do
       allow(Facter.fact(:apt_has_dist_updates)).to receive(:value).and_return(false)
     end
-    it { is_expected.to be nil }
+
+    it { is_expected.to be_nil }
   end
 
   describe 'when apt has updates' do
@@ -28,6 +29,7 @@ describe 'apt_package_dist_updates fact' do
                    "Conf planet.rb (22-2~bpo8+1 Debian Backports:-backports [all])\n"
       allow(Facter::Core::Execution).to receive(:execute).with('/usr/bin/apt-get -s -o Debug::NoLocking=true dist-upgrade 2>&1').and_return(apt_output)
     end
+
     it { is_expected.to eq(['extremetuxracer', 'planet.rb']) }
   end
 end
index aa21e649c60581504494d572bc4ad3f9be6db055..baaf0484e95cbce61aadac655efcc9a18cdb945d 100644 (file)
@@ -11,7 +11,8 @@ describe 'apt_security_updates fact' do
     before(:each) do
       allow(Facter.fact(:apt_has_dist_updates)).to receive(:value).and_return(false)
     end
-    it { is_expected.to be nil }
+
+    it { is_expected.to be_nil }
   end
 
   describe 'when apt has security updates' do
index 21352b5567406f3f8720caacd3f13d8e615c2ac3..ac87f666a150c8dcbc7f676ba690611dbccd5257 100644 (file)
@@ -11,7 +11,8 @@ describe 'apt_updates fact' do
     before(:each) do
       allow(Facter.fact(:apt_has_dist_updates)).to receive(:value).and_return(false)
     end
-    it { is_expected.to be nil }
+
+    it { is_expected.to be_nil }
   end
 
   describe 'when apt has updates' do
@@ -28,6 +29,7 @@ describe 'apt_updates fact' do
                    "Conf planet.rb (22-2~bpo8+1 Debian Backports:-backports [all])\n"
       allow(Facter::Core::Execution).to receive(:execute).with('/usr/bin/apt-get -s -o Debug::NoLocking=true dist-upgrade 2>&1').and_return(apt_output)
     end
+
     it { is_expected.to eq(2) }
   end
 end
index 0f0a74094c8a4f8697d1d3787259c9d1f3742008..77a95b4391708ca66011752bbb6b518a2c051c26 100644 (file)
@@ -11,6 +11,7 @@ describe 'apt_has_updates fact' do
     before(:each) do
       allow(Facter.fact(:osfamily)).to receive(:value).once.and_return('Redhat')
     end
+
     it { is_expected.to be_nil }
   end
 
@@ -20,6 +21,7 @@ describe 'apt_has_updates fact' do
       allow(File).to receive(:executable?) # Stub all other calls
       allow(File).to receive(:executable?).with('/usr/bin/apt-get').and_return(false)
     end
+
     it { is_expected.to be_nil }
   end
 
@@ -35,6 +37,7 @@ describe 'apt_has_updates fact' do
                    "Conf unhide.rb (22-2~bpo8+1 Debian Backports:-backports [all])\n"
       allow(Facter::Core::Execution).to receive(:execute).with('/usr/bin/apt-get -s -o Debug::NoLocking=true upgrade 2>&1').and_return(apt_output)
     end
+
     it { is_expected.to be true }
   end
 end
index 28516cac48ea56eae60dec97ea6902194da1874b..d54671542697a630f53ca3da2d6dcfd31aec4293 100644 (file)
@@ -11,7 +11,8 @@ describe 'apt_package_security_updates fact' do
     before(:each) do
       allow(Facter.fact(:apt_has_updates)).to receive(:value).and_return(false)
     end
-    it { is_expected.to be nil }
+
+    it { is_expected.to be_nil }
   end
 
   describe 'when apt has updates' do
index 69db490dd60afb0fd787de347d0a3b5479ea0895..7960306e00f1f6f1116020690b09f880ccd9a421 100644 (file)
@@ -11,7 +11,8 @@ describe 'apt_package_updates fact' do
     before(:each) do
       allow(Facter.fact(:apt_has_updates)).to receive(:value).and_return(false)
     end
-    it { is_expected.to be nil }
+
+    it { is_expected.to be_nil }
   end
 
   describe 'when apt has updates' do
@@ -26,6 +27,7 @@ describe 'apt_package_updates fact' do
                    "Conf unhide.rb (22-2~bpo8+1 Debian Backports:-backports [all])\n"
       allow(Facter::Core::Execution).to receive(:execute).with('/usr/bin/apt-get -s -o Debug::NoLocking=true upgrade 2>&1').and_return(apt_output)
     end
+
     it { is_expected.to eq(['tzdata', 'unhide.rb']) }
   end
 end
index 7621872d0890b776d12afbe903938e60b82f2945..f92282278494603a5e7cbcb3f77c0c3a7f26f3ba 100644 (file)
@@ -13,6 +13,7 @@ describe 'apt_reboot_required fact' do
       allow(File).to receive(:file?).and_return(true)
       allow(File).to receive(:file?).once.with('/var/run/reboot-required').and_return(true)
     end
+
     it { is_expected.to eq true }
   end
 
@@ -22,6 +23,7 @@ describe 'apt_reboot_required fact' do
       allow(File).to receive(:file?).and_return(true)
       allow(File).to receive(:file?).once.with('/var/run/reboot-required').and_return(false)
     end
+
     it { is_expected.to eq false }
   end
 end
index 9d3e587a89585982f9a9f6dc5002122406575d12..25ba3114ed26231ff46da0cf37c1804e4afc55d6 100644 (file)
@@ -11,7 +11,8 @@ describe 'apt_security_updates fact' do
     before(:each) do
       allow(Facter.fact(:apt_has_updates)).to receive(:value).and_return(false)
     end
-    it { is_expected.to be nil }
+
+    it { is_expected.to be_nil }
   end
 
   describe 'when apt has security updates' do
index a8eacbf20bcf7e8e937d4e562f2fedc736c78369..4397f766bbd4cd990c593bfad64ef74d558d8f7d 100644 (file)
@@ -11,7 +11,8 @@ describe 'apt_updates fact' do
     before(:each) do
       allow(Facter.fact(:apt_has_updates)).to receive(:value).and_return(false)
     end
-    it { is_expected.to be nil }
+
+    it { is_expected.to be_nil }
   end
 
   describe 'when apt has updates' do
@@ -26,6 +27,7 @@ describe 'apt_updates fact' do
                    "Conf unhide.rb (22-2~bpo8+1 Debian Backports:-backports [all])\n"
       allow(Facter::Core::Execution).to receive(:execute).with('/usr/bin/apt-get -s -o Debug::NoLocking=true upgrade 2>&1').and_return(apt_output)
     end
+
     it { is_expected.to eq(2) }
   end
 end
index d2fa8b2644802bbdfe6c3c91f81e514e8faac8fa..668a953bff76719b5333bf5c2013d8946ad821d4 100644 (file)
@@ -22,6 +22,7 @@ describe Puppet::Type.type(:apt_key).provider(:apt_key) do
         ['adv', '--no-tty', '--list-keys', '--with-colons', '--fingerprint', '--fixed-list-mode'],
       ).and_return('uid:-::::1284991450::07BEBE04F4AE4A8E885A761325717D8509D9C1DC::Ubuntu Extras Archive Automatic Signing Key <ftpmaster@ubuntu.com>::::::::::0:')
     end
+
     it 'returns no resources' do
       expect(described_class.instances.size).to eq(0)
     end
@@ -43,6 +44,7 @@ describe Puppet::Type.type(:apt_key).provider(:apt_key) do
         ['adv', '--no-tty', '--list-keys', '--with-colons', '--fingerprint', '--fixed-list-mode'],
       ).and_return(command_output)
     end
+
     it 'returns 2 resources' do # rubocop:disable RSpec/MultipleExpectations
       expect(described_class.instances.size).to eq(2)
       expect(described_class.instances[0].name).to eq('630239CC130E1A7FD81A27B140976EAF437D05B5')