Class: RuboCop::Cop::Minitest::RefuteNil
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Minitest::RefuteNil
- Extended by:
- AutoCorrector
- Includes:
- ArgumentRangeHelper, NilAssertionHandleable
- Defined in:
- lib/rubocop/cop/minitest/refute_nil.rb
Overview
Enforces the test to use ‘refute_nil` instead of using `refute_equal(nil, something)`, `refute(something.nil?)`, or `refute_predicate(something, :nil?)`.
Constant Summary collapse
- ASSERTION_TYPE =
'refute'
- RESTRICT_ON_SEND =
%i[refute refute_equal refute_predicate].freeze
Constants included from NilAssertionHandleable
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
38 39 40 41 42 |
# File 'lib/rubocop/cop/minitest/refute_nil.rb', line 38 def on_send(node) nil_refutation(node) do |actual, | register_offense(node, actual, ) end end |