Class: RuboCop::Cop::Minitest::RefutePredicate

Inherits:
Base
  • Object
show all
Extended by:
AutoCorrector
Includes:
ArgumentRangeHelper, PredicateAssertionHandleable
Defined in:
lib/rubocop/cop/minitest/refute_predicate.rb

Overview

Enforces the test to use ‘refute_predicate` instead of using `refute(obj.a_predicate_method?)`.

Examples:

# bad
refute(obj.one?)
refute(obj.one?, 'message')

# good
refute_predicate(obj, :one?)
refute_predicate(obj, :one?, 'message')

Constant Summary collapse

MSG =
'Prefer using `refute_predicate(%<new_arguments>s)`.'
RESTRICT_ON_SEND =

rubocop:disable InternalAffairs/UselessRestrictOnSend

%i[refute].freeze

Method Summary

Methods included from PredicateAssertionHandleable

#autocorrect, #on_send