lib/rubocop/cop/rspec/focus.rb in rubocop-rspec-2.18.1 vs lib/rubocop/cop/rspec/focus.rb in rubocop-rspec-2.19.0
- old
+ new
@@ -59,14 +59,13 @@
{(send #rspec? #focusable_selector? <$(sym :focus) ...>)
(send #rspec? #focusable_selector? ... (hash <$(pair (sym :focus) true) ...>))}
PATTERN
# @!method focused_block?(node)
- def_node_matcher :focused_block?,
- send_pattern(<<~PATTERN)
- {#ExampleGroups.focused #Examples.focused}
- PATTERN
+ def_node_matcher :focused_block?, <<~PATTERN
+ (send #rspec? {#ExampleGroups.focused #Examples.focused} ...)
+ PATTERN
def on_send(node)
focus_metadata(node) do |focus|
add_offense(focus) do |corrector|
if focus.pair_type? || focus.str_type? || focus.sym_type?
@@ -86,10 +85,10 @@
metadata(node, &block)
end
def with_surrounding(focus)
range_with_space =
- range_with_surrounding_space(focus.loc.expression, side: :left)
+ range_with_surrounding_space(focus.source_range, side: :left)
range_with_surrounding_comma(range_with_space, :left)
end
def correct_send(corrector, focus)