lib/rubocop/cop/mixin/minitest_cop_rule.rb in rubocop-minitest-0.17.2 vs lib/rubocop/cop/mixin/minitest_cop_rule.rb in rubocop-minitest-0.18.0
- old
+ new
@@ -26,12 +26,11 @@
class_eval(<<~RUBY, __FILE__, __LINE__ + 1)
include ArgumentRangeHelper
extend AutoCorrector
- MSG = 'Prefer using `#{preferred_method}(%<new_arguments>s)` over ' \
- '`#{assertion_method}(%<original_arguments>s)`.'
+ MSG = 'Prefer using `#{preferred_method}(%<new_arguments>s)`.'
RESTRICT_ON_SEND = %i[#{assertion_method}].freeze
def on_send(node)
return unless node.method?(:#{assertion_method})
return unless (arguments = peel_redundant_parentheses_from(node.arguments))
@@ -68,15 +67,12 @@
new_arguments = [
new_arguments(arguments),
message_argument&.source
].flatten.compact.join(', ')
- original_arguments = arguments.map(&:source).join(', ')
-
format(
MSG,
- new_arguments: new_arguments,
- original_arguments: original_arguments
+ new_arguments: new_arguments
)
end
def new_arguments(arguments)
receiver = correct_receiver(arguments.first.receiver)