lib/rubocop/cop/rspec/focus.rb in rubocop-rspec-2.23.2 vs lib/rubocop/cop/rspec/focus.rb in rubocop-rspec-2.24.0
- old
+ new
@@ -77,9 +77,11 @@
def_node_matcher :focused_block?, <<~PATTERN
(send #rspec? {#ExampleGroups.focused #Examples.focused} ...)
PATTERN
def on_send(node)
+ return if node.chained? || node.each_ancestor(:def, :defs).any?
+
focus_metadata(node) do |focus|
add_offense(focus) do |corrector|
if focus.pair_type? || focus.str_type? || focus.sym_type?
corrector.remove(with_surrounding(focus))
elsif focus.send_type?