lib/rubocop/cop/rspec/leading_subject.rb in rubocop-rspec-1.25.1 vs lib/rubocop/cop/rspec/leading_subject.rb in rubocop-rspec-1.26.0
- old
+ new
@@ -29,10 +29,10 @@
class LeadingSubject < Cop
include RangeHelp
MSG = 'Declare `subject` above any other `let` declarations.'.freeze
- def_node_matcher :subject?, '(block $(send nil? :subject ...) args ...)'
+ def_node_matcher :subject?, Subject::ALL.block_pattern
def on_block(node)
return unless subject?(node) && !in_spec_block?(node)
node.parent.each_child_node do |sibling|