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).
This commit is contained in:
Alec Clarke 2018-10-13 07:23:57 -07:00
parent 662641557e
commit 3a8e87134b
2 changed files with 1 additions and 8 deletions

View File

@ -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:

View File

@ -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