Skip to content

Commit

Permalink
Merge pull request #2025 from rubocop/use-node-groups
Browse files Browse the repository at this point in the history
Use node groups in node patterns to replace unions of types
  • Loading branch information
bquorning authored Feb 16, 2025
2 parents 17640ad + 876b415 commit dac4256
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rspec/be_eq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class BeEq < Base

# @!method eq_type_with_identity?(node)
def_node_matcher :eq_type_with_identity?, <<~PATTERN
(send nil? :eq {true false nil})
(send nil? :eq {boolean nil})
PATTERN

def on_send(node)
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rspec/be_eql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class BeEql < Base

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

def on_send(node)
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rspec/predicate_matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def cannot_replace_predicate?(send_node)

# @!method be_bool?(node)
def_node_matcher :be_bool?, <<~PATTERN
(send nil? {:be :eq :eql :equal} {true false})
(send nil? {:be :eq :eql :equal} boolean)
PATTERN

# @!method be_boolthy?(node)
Expand Down

0 comments on commit dac4256

Please sign in to comment.