(CONT-773) Rubocop Manual Fix 4 - Performance/CollectionLiteralInLoop
authordavid22swan <david.swan@puppet.com>
Wed, 26 Apr 2023 16:10:38 +0000 (17:10 +0100)
committerdavid22swan <david.swan@puppet.com>
Wed, 26 Apr 2023 16:10:38 +0000 (17:10 +0100)
.rubocop_todo.yml
spec/classes/apt_update_spec.rb

index 5c52997eb081137b1c9da84c47220c09329802a2..e978cec5ca640281058ae13e1a7d9c85a493c5ba 100644 (file)
@@ -32,12 +32,6 @@ Metrics/MethodLength:
 Metrics/PerceivedComplexity:
   Max: 12
 
-# Offense count: 1
-# Configuration parameters: MinSize.
-Performance/CollectionLiteralInLoop:
-  Exclude:
-    - 'spec/classes/apt_update_spec.rb'
-
 # Offense count: 6
 # Configuration parameters: Prefixes, AllowedPatterns.
 # Prefixes: when, with, without
index ada31b160060b30742cc661d398191545d446027..ede2fe02e18c18b7d8e2c6a4accee3cd55b83a6b 100644 (file)
@@ -154,7 +154,8 @@ describe 'apt::update', type: :class do
 
   ['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|
+      pair = { 'we are due for a run' => 1_406_660_561, 'the update-success-stamp file does not exist' => -1 }
+      pair.each_pair do |desc, factval|
         context "when $apt_update_last_success indicates #{desc}" do
           let(:facts) do
             {