Sha256: 16fc673de5e7d38125c22796d5c05dbb5437b9ce7f9c50efe0d06fde1c59f4a5

Contents?: true

Size: 614 Bytes

Versions: 14

Compression:

Stored size: 614 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module Minitest
      # This cop enforces the use of `refute_kind_of(Class, object)`
      # over `refute(object.kind_of?(Class))`.
      #
      # @example
      #   # bad
      #   refute(object.kind_of?(Class))
      #   refute(object.kind_of?(Class), 'message')
      #
      #   # good
      #   refute_kind_of(Class, object)
      #   refute_kind_of(Class, object, 'message')
      #
      class RefuteKindOf < Base
        extend MinitestCopRule

        define_rule :refute, target_method: :kind_of?, inverse: true
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rubocop-minitest-0.19.1 lib/rubocop/cop/minitest/refute_kind_of.rb
rubocop-minitest-0.19.0 lib/rubocop/cop/minitest/refute_kind_of.rb
rubocop-minitest-0.18.0 lib/rubocop/cop/minitest/refute_kind_of.rb
rubocop-minitest-0.17.2 lib/rubocop/cop/minitest/refute_kind_of.rb
rubocop-minitest-0.17.1 lib/rubocop/cop/minitest/refute_kind_of.rb
rubocop-minitest-0.17.0 lib/rubocop/cop/minitest/refute_kind_of.rb
rubocop-minitest-0.16.0 lib/rubocop/cop/minitest/refute_kind_of.rb
rubocop-minitest-0.15.2 lib/rubocop/cop/minitest/refute_kind_of.rb
rubocop-minitest-0.15.1 lib/rubocop/cop/minitest/refute_kind_of.rb
rubocop-minitest-0.15.0 lib/rubocop/cop/minitest/refute_kind_of.rb
rubocop-minitest-0.14.0 lib/rubocop/cop/minitest/refute_kind_of.rb
rubocop-minitest-0.13.0 lib/rubocop/cop/minitest/refute_kind_of.rb
rubocop-minitest-0.12.1 lib/rubocop/cop/minitest/refute_kind_of.rb
rubocop-minitest-0.12.0 lib/rubocop/cop/minitest/refute_kind_of.rb