lib/rubocop/rspec/top_level_describe.rb in rubocop-rspec-1.6.0 vs lib/rubocop/rspec/top_level_describe.rb in rubocop-rspec-1.7.0

- old
+ new

@@ -1,8 +1,14 @@ module RuboCop module RSpec # Helper methods for top level describe cops module TopLevelDescribe + extend NodePattern::Macros + + def_node_matcher :described_constant, <<-PATTERN + (block $(send _ :describe $(const ...)) (args) $_) + PATTERN + def on_send(node) return unless respond_to?(:on_top_level_describe) return unless top_level_describe?(node) _receiver, _method_name, *args = *node