lib/rubocop/cop/minitest/refute_equal.rb in rubocop-minitest-0.31.0 vs lib/rubocop/cop/minitest/refute_equal.rb in rubocop-minitest-0.31.1
- old
+ new
@@ -7,11 +7,10 @@
# over `assert(expected != actual)` or `assert(! expected == actual)`.
#
# @example
# # bad
# assert("rubocop-minitest" != actual)
- # assert(! "rubocop-minitest" == actual)
#
# # good
# refute_equal("rubocop-minitest", actual)
#
class RefuteEqual < Base
@@ -20,10 +19,10 @@
MSG = 'Prefer using `refute_equal(%<preferred>s)`.'
RESTRICT_ON_SEND = %i[assert].freeze
def_node_matcher :assert_not_equal, <<~PATTERN
- (send nil? :assert {(send $_ :!= $_) (send (send $_ :! ) :== $_) } $... )
+ (send nil? :assert (send $_ :!= $_) $... )
PATTERN
def on_send(node)
preferred = process_not_equal(node)
return unless preferred