Skip to content

Commit

Permalink
Merge pull request #1775 from rubocop/1766
Browse files Browse the repository at this point in the history
Add a case for `be_all` fixes to the `RSpec/RedundantPredicateMatcher` documentation
  • Loading branch information
pirj authored Jan 9, 2024
2 parents bd8e3b9 + 48461e4 commit 326f2cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/modules/ROOT/pages/cops_rspec.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4515,10 +4515,12 @@ Checks for redundant predicate matcher.
# bad
expect(foo).to be_exist(bar)
expect(foo).not_to be_include(bar)
expect(foo).to be_all(bar)
# good
expect(foo).to exist(bar)
expect(foo).not_to include(bar)
expect(foo).to all be(bar)
----

=== References
Expand Down
2 changes: 2 additions & 0 deletions lib/rubocop/cop/rspec/redundant_predicate_matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ module RSpec
# # bad
# expect(foo).to be_exist(bar)
# expect(foo).not_to be_include(bar)
# expect(foo).to be_all(bar)
#
# # good
# expect(foo).to exist(bar)
# expect(foo).not_to include(bar)
# expect(foo).to all be(bar)
#
class RedundantPredicateMatcher < Base
extend AutoCorrector
Expand Down

0 comments on commit 326f2cf

Please sign in to comment.