Sha256: afdeb5a2bf573739bf6395658791d7814f665a97b25d8191f839a2cfd3cef6a2
Contents?: true
Size: 838 Bytes
Versions: 32
Compression:
Stored size: 838 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop module Minitest # Enforces the test to use `assert_predicate` # instead of using `assert(obj.a_predicate_method?)`. # # @example # # bad # assert(obj.one?) # assert(obj.one?, 'message') # # # good # assert_predicate(obj, :one?) # assert_predicate(obj, :one?, 'message') # class AssertPredicate < Base include ArgumentRangeHelper include PredicateAssertionHandleable extend AutoCorrector MSG = 'Prefer using `assert_predicate(%<new_arguments>s)`.' RESTRICT_ON_SEND = %i[assert].freeze # rubocop:disable InternalAffairs/UselessRestrictOnSend private def assertion_type 'assert' end end end end end
Version data entries
32 entries across 32 versions & 1 rubygems