Skip to content

Commit

Permalink
Follow up #1768 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
ydah committed Jan 5, 2024
1 parent 6e19ee6 commit 3b6eeb6
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 3b6eeb6

Please sign in to comment.