lib/rubocop/cop/rspec/let_before_examples.rb in rubocop-rspec-1.17.1 vs lib/rubocop/cop/rspec/let_before_examples.rb in rubocop-rspec-1.18.0
- old
+ new
@@ -42,12 +42,16 @@
PATTERN
def on_block(node)
return unless example_group_with_body?(node)
- _describe, _args, body = *node
+ check_let_declarations(node.body) if multiline_block?(node.body)
+ end
- check_let_declarations(body)
+ private
+
+ def multiline_block?(block)
+ block.begin_type?
end
def check_let_declarations(node)
example_found = false