lib/rubocop/cop/minitest/assert_empty.rb in rubocop-minitest-0.33.0 vs lib/rubocop/cop/minitest/assert_empty.rb in rubocop-minitest-0.34.0
- old
+ new
@@ -20,15 +20,14 @@
define_rule :assert, target_method: :empty?
remove_method :on_send
def on_send(node)
return unless node.method?(:assert)
- return unless (arguments = peel_redundant_parentheses_from(node.arguments))
- return unless arguments.first.respond_to?(:method?) && arguments.first.method?(:empty?)
- return unless arguments.first.arguments.empty?
+ return unless node.first_argument.respond_to?(:method?) && node.first_argument.method?(:empty?)
+ return unless node.first_argument.arguments.empty?
- add_offense(node, message: offense_message(arguments)) do |corrector|
- autocorrect(corrector, node, arguments)
+ add_offense(node, message: offense_message(node.arguments)) do |corrector|
+ autocorrect(corrector, node, node.arguments)
end
end
end
end
end