lib/rubocop/cop/rspec/shared_examples.rb in rubocop-rspec-2.18.1 vs lib/rubocop/cop/rspec/shared_examples.rb in rubocop-rspec-2.19.0
- old
+ new
@@ -22,13 +22,15 @@
#
class SharedExamples < Base
extend AutoCorrector
# @!method shared_examples(node)
- def_node_matcher :shared_examples,
- send_pattern(
- '{#SharedGroups.all #Includes.all}'
- )
+ def_node_matcher :shared_examples, <<~PATTERN
+ {
+ (send #rspec? #SharedGroups.all ...)
+ (send nil? #Includes.all ...)
+ }
+ PATTERN
def on_send(node)
shared_examples(node) do
ast_node = node.first_argument
next unless ast_node&.sym_type?