lib/rubocop/cop/rspec/scattered_let.rb in rubocop-rspec-1.18.0 vs lib/rubocop/cop/rspec/scattered_let.rb in rubocop-rspec-1.19.0
- old
+ new
@@ -27,11 +27,11 @@
# end
#
class ScatteredLet < Cop
MSG = 'Group all let/let! blocks in the example group together.'.freeze
- def_node_matcher :let?, '(block (send nil {:let :let!} ...) ...)'
+ def_node_matcher :let?, '(block (send nil? {:let :let!} ...) ...)'
def on_block(node)
return unless example_group_with_body?(node)
_describe, _args, body = *node
@@ -43,10 +43,10 @@
let_found = false
mix_found = false
node.each_child_node do |child|
if let?(child)
- add_offense(child, :expression) if mix_found
+ add_offense(child, location: :expression) if mix_found
let_found = true
elsif let_found
mix_found = true
end
end