Skip to content

Commit dac4256

Browse files
authored
Merge pull request #2025 from rubocop/use-node-groups
Use node groups in node patterns to replace unions of types
2 parents 17640ad + 876b415 commit dac4256

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/rubocop/cop/rspec/be_eq.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class BeEq < Base
3131

3232
# @!method eq_type_with_identity?(node)
3333
def_node_matcher :eq_type_with_identity?, <<~PATTERN
34-
(send nil? :eq {true false nil})
34+
(send nil? :eq {boolean nil})
3535
PATTERN
3636

3737
def on_send(node)

lib/rubocop/cop/rspec/be_eql.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class BeEql < Base
4545

4646
# @!method eql_type_with_identity(node)
4747
def_node_matcher :eql_type_with_identity, <<~PATTERN
48-
(send _ :to $(send nil? :eql {true false int float sym nil}))
48+
(send _ :to $(send nil? :eql {boolean int float sym nil}))
4949
PATTERN
5050

5151
def on_send(node)

lib/rubocop/cop/rspec/predicate_matcher.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def cannot_replace_predicate?(send_node)
4343

4444
# @!method be_bool?(node)
4545
def_node_matcher :be_bool?, <<~PATTERN
46-
(send nil? {:be :eq :eql :equal} {true false})
46+
(send nil? {:be :eq :eql :equal} boolean)
4747
PATTERN
4848

4949
# @!method be_boolthy?(node)

0 commit comments

Comments
 (0)