lib/rubocop/cop/rspec/named_subject.rb in rubocop-rspec-2.18.1 vs lib/rubocop/cop/rspec/named_subject.rb in rubocop-rspec-2.19.0
- old
+ new
@@ -80,15 +80,17 @@
include ConfigurableEnforcedStyle
MSG = 'Name your test subject if you need to reference it explicitly.'
# @!method example_or_hook_block?(node)
- def_node_matcher :example_or_hook_block?,
- block_pattern('{#Examples.all #Hooks.all}')
+ def_node_matcher :example_or_hook_block?, <<~PATTERN
+ (block (send nil? {#Examples.all #Hooks.all} ...) ...)
+ PATTERN
# @!method shared_example?(node)
- def_node_matcher :shared_example?,
- block_pattern('#SharedGroups.examples')
+ def_node_matcher :shared_example?, <<~PATTERN
+ (block (send #rspec? #SharedGroups.examples ...) ...)
+ PATTERN
# @!method subject_usage(node)
def_node_search :subject_usage, '$(send nil? :subject)'
def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler