From 48461e40d36575339f5e15c0d72cdddee259704d Mon Sep 17 00:00:00 2001 From: ydah <13041216+ydah@users.noreply.github.com> Date: Tue, 9 Jan 2024 10:51:52 +0900 Subject: [PATCH] Add a case for `be_all` fixes to the `RSpec/RedundantPredicateMatcher` documentation Resolve: https://github.com/rubocop/rubocop-rspec/issues/1766 --- docs/modules/ROOT/pages/cops_rspec.adoc | 2 ++ lib/rubocop/cop/rspec/redundant_predicate_matcher.rb | 2 ++ 2 files changed, 4 insertions(+) diff --git a/docs/modules/ROOT/pages/cops_rspec.adoc b/docs/modules/ROOT/pages/cops_rspec.adoc index ff7bc9e6e..c94994dde 100644 --- a/docs/modules/ROOT/pages/cops_rspec.adoc +++ b/docs/modules/ROOT/pages/cops_rspec.adoc @@ -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 diff --git a/lib/rubocop/cop/rspec/redundant_predicate_matcher.rb b/lib/rubocop/cop/rspec/redundant_predicate_matcher.rb index 2c3eec266..ebe253b82 100644 --- a/lib/rubocop/cop/rspec/redundant_predicate_matcher.rb +++ b/lib/rubocop/cop/rspec/redundant_predicate_matcher.rb @@ -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