From 46c94754d754cdf94fce800dd01cc48844b37ac8 Mon Sep 17 00:00:00 2001 From: david22swan Date: Wed, 26 Apr 2023 17:10:38 +0100 Subject: [PATCH] (CONT-773) Rubocop Manual Fix 4 - Performance/CollectionLiteralInLoop --- .rubocop_todo.yml | 6 ------ spec/classes/apt_update_spec.rb | 3 ++- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 5c52997..e978cec 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -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 diff --git a/spec/classes/apt_update_spec.rb b/spec/classes/apt_update_spec.rb index ada31b1..ede2fe0 100644 --- a/spec/classes/apt_update_spec.rb +++ b/spec/classes/apt_update_spec.rb @@ -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 { -- 2.45.2