lib/rubocop/cop/rspec/described_class.rb in rubocop-rspec-1.21.0 vs lib/rubocop/cop/rspec/described_class.rb in rubocop-rspec-1.22.0
- old
+ new
@@ -79,14 +79,13 @@
private
def find_usage(node, &block)
yield(node) if offensive?(node)
- return unless node.is_a?(Parser::AST::Node)
return if scope_change?(node) || node.const_type?
- node.children.each do |child|
+ node.each_child_node do |child|
find_usage(child, &block)
end
end
def message(offense)
@@ -114,11 +113,10 @@
def offensive?(node)
if style == :described_class
node.eql?(@described_class)
else
- _receiver, method_name, *_args = *node
- method_name == :described_class
+ node.method_name == :described_class
end
end
end
end
end