lib/rubocop/cop/minitest/refute_path_exists.rb in rubocop-minitest-0.17.2 vs lib/rubocop/cop/minitest/refute_path_exists.rb in rubocop-minitest-0.18.0
- old
+ new
@@ -16,11 +16,11 @@
# refute_path_exists(path, 'message')
#
class RefutePathExists < Base
extend AutoCorrector
- MSG = 'Prefer using `%<good_method>s` over `%<bad_method>s`.'
+ MSG = 'Prefer using `%<good_method>s`.'
RESTRICT_ON_SEND = %i[refute].freeze
def_node_matcher :refute_file_exists, <<~PATTERN
(send nil? :refute
(send
@@ -30,10 +30,10 @@
def on_send(node)
refute_file_exists(node) do |path, failure_message|
failure_message = failure_message.first
good_method = build_good_method(path, failure_message)
- message = format(MSG, good_method: good_method, bad_method: node.source)
+ message = format(MSG, good_method: good_method)
add_offense(node, message: message) do |corrector|
corrector.replace(node, good_method)
end
end