lib/rubocop/cop/minitest/refute_false.rb in rubocop-minitest-0.26.1 vs lib/rubocop/cop/minitest/refute_false.rb in rubocop-minitest-0.27.0
- old
+ new
@@ -3,9 +3,19 @@
module RuboCop
module Cop
module Minitest
# Enforces the use of `refute(object)` over `assert_equal(false, object)`.
#
+ # @safety
+ # This cop is unsafe because it cannot detect failure when second argument is `nil`.
+ # False positives cannot be prevented when this is a variable or method return value.
+ #
+ # [source,ruby]
+ # ----
+ # assert_equal(false, nil) # failure
+ # refute(nil) # success
+ # ----
+ #
# @example
# # bad
# assert_equal(false, actual)
# assert_equal(false, actual, 'message')
#