From 3a8e87134b43c286eaf56ca983525fdc556939b7 Mon Sep 17 00:00:00 2001 From: Alec Clarke Date: Sat, 13 Oct 2018 07:23:57 -0700 Subject: [PATCH] Use the `all` matcher to check the existence of each path. This change allows us to remove the `RSpec/IteratedExpectation` rule from `.rubocop_todo.yml` as we no longer iterate over each path to check existence. Note: We this PR didn't change the subsequent test checking for the negative expectations as this isn't part of the rule (see: https://github.com/rubocop-hq/rubocop-rspec/issues/278). --- Library/Homebrew/test/.rubocop_todo.yml | 5 ----- .../test/cask/artifact/uninstall_zap_shared_examples.rb | 4 +--- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/Library/Homebrew/test/.rubocop_todo.yml b/Library/Homebrew/test/.rubocop_todo.yml index d3a7d38277..c3bbe7dc26 100644 --- a/Library/Homebrew/test/.rubocop_todo.yml +++ b/Library/Homebrew/test/.rubocop_todo.yml @@ -78,11 +78,6 @@ RSpec/InstanceVariable: - 'utils/git_spec.rb' - 'version_spec.rb' -# Offense count: 1 -RSpec/IteratedExpectation: - Exclude: - - 'cask/artifact/uninstall_zap_shared_examples.rb' - # Offense count: 1 # Cop supports --auto-correct. RSpec/LeadingSubject: diff --git a/Library/Homebrew/test/cask/artifact/uninstall_zap_shared_examples.rb b/Library/Homebrew/test/cask/artifact/uninstall_zap_shared_examples.rb index 1102091806..56a8408360 100644 --- a/Library/Homebrew/test/cask/artifact/uninstall_zap_shared_examples.rb +++ b/Library/Homebrew/test/cask/artifact/uninstall_zap_shared_examples.rb @@ -183,9 +183,7 @@ shared_examples "#uninstall_phase or #zap_phase" do end it "is supported" do - paths.each do |path| - expect(path).to exist - end + expect(paths).to all(exist) subject