lib/rubocop/cop/rspec/leading_subject.rb in rubocop-rspec-1.18.0 vs lib/rubocop/cop/rspec/leading_subject.rb in rubocop-rspec-1.19.0
- old
+ new
@@ -27,18 +27,18 @@
# end
# end
class LeadingSubject < Cop
MSG = 'Declare `subject` above any other `let` declarations.'.freeze
- def_node_matcher :subject?, '(block $(send nil :subject ...) args ...)'
+ def_node_matcher :subject?, '(block $(send nil? :subject ...) args ...)'
def on_block(node)
return unless subject?(node) && !in_spec_block?(node)
node.parent.each_child_node do |sibling|
break if sibling.equal?(node)
- break add_offense(node, :expression) if let?(sibling)
+ break add_offense(node, location: :expression) if let?(sibling)
end
end
def autocorrect(node)
lambda do |corrector|