lib/rubocop/cop/rspec/focus.rb in rubocop-rspec-1.35.0 vs lib/rubocop/cop/rspec/focus.rb in rubocop-rspec-1.36.0
- old
+ new
@@ -24,22 +24,20 @@
focusable =
ExampleGroups::GROUPS +
ExampleGroups::SKIPPED +
Examples::EXAMPLES +
- Examples::SKIPPED
+ Examples::SKIPPED +
+ Examples::PENDING
focused = ExampleGroups::FOCUSED + Examples::FOCUSED
FOCUSABLE_SELECTORS = focusable.node_pattern_union
- FOCUS_SYMBOL = s(:sym, :focus)
- FOCUS_TRUE = s(:pair, FOCUS_SYMBOL, s(:true))
-
def_node_matcher :metadata, <<-PATTERN
- {(send #{RSPEC} #{FOCUSABLE_SELECTORS} ... (hash $...))
- (send #{RSPEC} #{FOCUSABLE_SELECTORS} $...)}
+ {(send #{RSPEC} #{FOCUSABLE_SELECTORS} <$(sym :focus) ...>)
+ (send #{RSPEC} #{FOCUSABLE_SELECTORS} ... (hash <$(pair (sym :focus) true) ...>))}
PATTERN
def_node_matcher :focused_block?, focused.send_pattern
def on_send(node)
@@ -51,13 +49,10 @@
private
def focus_metadata(node, &block)
yield(node) if focused_block?(node)
- metadata(node) do |matches|
- matches.grep(FOCUS_SYMBOL, &block)
- matches.grep(FOCUS_TRUE, &block)
- end
+ metadata(node, &block)
end
end
end
end
end