lib/rubocop/cop/rspec/described_class.rb in rubocop-rspec-1.0.1 vs lib/rubocop/cop/rspec/described_class.rb in rubocop-rspec-1.1.0
- old
+ new
@@ -31,9 +31,15 @@
return unless object && object.type == :const
inspect_children(body, object)
end
+ def autocorrect(node)
+ @corrections << lambda do |corrector|
+ corrector.replace(node.loc.expression, 'described_class')
+ end
+ end
+
private
def inspect_children(node, object)
return unless node.is_a? Parser::AST::Node
return if scope_change?(node) || node.type == :const