lib/rubocop/cop/mixin/includes_cop_rule.rb in rubocop-minitest-0.6.1 vs lib/rubocop/cop/mixin/includes_cop_rule.rb in rubocop-minitest-0.6.2
- old
+ new
@@ -12,10 +12,10 @@
'`#{target_method}(%<original_arguments>s)`.'
def on_send(node)
return unless node.method?(:#{target_method})
return unless (arguments = peel_redundant_parentheses_from(node.arguments))
- return unless arguments.first.method?(:include?)
+ return unless arguments.first.respond_to?(:method?) && arguments.first.method?(:include?)
add_offense(node, message: offense_message(arguments))
end
def autocorrect(node)