Skip to content

Commit

Permalink
Merge pull request #1769 from rubocop/followup
Browse files Browse the repository at this point in the history
Follow up #1768 (comment)
  • Loading branch information
ydah authored Jan 5, 2024
2 parents 6e19ee6 + 3b6eeb6 commit 6d9eec2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/rubocop/cop/rspec/shared_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,13 @@ class SharedExamples < Base
# @!method shared_examples(node)
def_node_matcher :shared_examples, <<~PATTERN
{
(send #rspec? #SharedGroups.all ...)
(send nil? #Includes.all ...)
(send #rspec? #SharedGroups.all $_ ...)
(send nil? #Includes.all $_ ...)
}
PATTERN

def on_send(node)
shared_examples(node) do
next unless (ast_node = node.first_argument)
shared_examples(node) do |ast_node|
next unless offense?(ast_node)

checker = new_checker(ast_node)
Expand Down

0 comments on commit 6d9eec2

Please sign in to comment.