Class: RuboCop::Cop::Minitest::RefuteKindOf

Inherits:
Base
  • Object
show all
Extended by:
RuboCop::Cop::MinitestCopRule
Defined in:
lib/rubocop/cop/minitest/refute_kind_of.rb

Overview

Enforces the use of ‘refute_kind_of(Class, object)` over `refute(object.kind_of?(Class))`.

Examples:

# bad
refute(object.kind_of?(Class))
refute(object.kind_of?(Class), 'message')

# bad
# `is_a?` is an alias for `kind_of?`
refute(object.is_of?(Class))
refute(object.is_of?(Class), 'message')

# good
refute_kind_of(Class, object)
refute_kind_of(Class, object, 'message')

Method Summary

Methods included from RuboCop::Cop::MinitestCopRule

define_rule