(CONT-773) Rubocop Manual Fix 5 - RSpec/ContextWording
authordavid22swan <david.swan@puppet.com>
Wed, 26 Apr 2023 16:47:07 +0000 (17:47 +0100)
committerdavid22swan <david.swan@puppet.com>
Wed, 26 Apr 2023 16:47:07 +0000 (17:47 +0100)
.rubocop_todo.yml
spec/classes/apt_spec.rb
spec/classes/apt_update_spec.rb
spec/unit/puppet/provider/apt_key_spec.rb

index e978cec5ca640281058ae13e1a7d9c85a493c5ba..8b672acfb3a26ff91534989e4a5387f64a9132ce 100644 (file)
@@ -32,15 +32,6 @@ Metrics/MethodLength:
 Metrics/PerceivedComplexity:
   Max: 12
 
-# Offense count: 6
-# Configuration parameters: Prefixes, AllowedPatterns.
-# Prefixes: when, with, without
-RSpec/ContextWording:
-  Exclude:
-    - 'spec/classes/apt_spec.rb'
-    - 'spec/classes/apt_update_spec.rb'
-    - 'spec/unit/puppet/provider/apt_key_spec.rb'
-
 # Offense count: 32
 # Configuration parameters: IgnoredMetadata.
 RSpec/DescribeClass:
index 0e6b6b07da12aa89f9e905544095b6c2d746d81a..12479b142dd604b20d4b85eb27ac9cda7e0d75ad 100644 (file)
@@ -389,7 +389,7 @@ describe 'apt' do
     }
 
     facts_hash.each do |os, facts|
-      context "on #{os}" do
+      context "when on #{os}" do
         let(:facts) do
           facts
         end
index ede2fe02e18c18b7d8e2c6a4accee3cd55b83a6b..c46771a52d8b226a22101dd005e3c98a96970c96 100644 (file)
@@ -62,7 +62,7 @@ describe 'apt::update', type: :class do
       end
     end
 
-    context 'and Exec[apt_update] refreshonly is overridden to true and has recent run' do
+    context 'when Exec[apt_update] refreshonly is overridden to true and has recent run' do
       let(:facts) do
         {
           os: {
index 7cab6ceb490766f49c837239cab2ffbae0f680f9..d683c9bf7200e4c185e44394c3e81a678ef71c18 100644 (file)
@@ -15,7 +15,7 @@ describe Puppet::Type.type(:apt_key).provider(:apt_key) do
     end
   end
 
-  context 'self.instances no key' do
+  context 'with self.instances no key' do
     before :each do
       # Unable to remove `master` from below terminology as it relies on outside code
       allow(described_class).to receive(:apt_key).with(
@@ -28,7 +28,7 @@ describe Puppet::Type.type(:apt_key).provider(:apt_key) do
     end
   end
 
-  context 'self.instances multiple keys' do
+  context 'with self.instances multiple keys' do
     before :each do
       command_output = <<~OUTPUT
         Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.DU0GdRxjmE --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/puppetlabs-pc1-keyring.gpg --no-tty --list-keys --with-colons --fingerprint --fixed-list-mode
@@ -54,7 +54,7 @@ describe Puppet::Type.type(:apt_key).provider(:apt_key) do
     end
   end
 
-  context 'create apt_key resource' do
+  context 'with create apt_key resource' do
     it 'apt_key with content set and source nil' do
       expect(described_class).to receive(:apt_key).with(['adv', '--no-tty',
                                                          '--keyserver',
@@ -172,7 +172,7 @@ describe Puppet::Type.type(:apt_key).provider(:apt_key) do
     end
   end
 
-  context 'key_line_hash function' do
+  context 'with key_line_hash function' do
     it 'matches rsa' do
       expect(described_class.key_line_hash('pub:-:1024:1:40976EAF437D05B5:1095016255:::-:::scESC:', 'fpr:::::::::630239CC130E1A7FD81A27B140976EAF437D05B5:')).to include(
         key_expiry: nil,