Sha256: d0454c438717f242030d848c2b88e351b284e1ef80364ee7f1e6f04a81aefbb5

Contents?: true

Size: 637 Bytes

Versions: 18

Compression:

Stored size: 637 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module Minitest
      # Enforces the use of `refute_instance_of(Class, object)`
      # over `refute(object.instance_of?(Class))`.
      #
      # @example
      #   # bad
      #   refute(object.instance_of?(Class))
      #   refute(object.instance_of?(Class), 'message')
      #
      #   # good
      #   refute_instance_of(Class, object)
      #   refute_instance_of(Class, object, 'message')
      #
      class RefuteInstanceOf < Base
        extend MinitestCopRule

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

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
rubocop-minitest-0.29.0 lib/rubocop/cop/minitest/refute_instance_of.rb
rubocop-minitest-0.28.0 lib/rubocop/cop/minitest/refute_instance_of.rb
rubocop-minitest-0.27.0 lib/rubocop/cop/minitest/refute_instance_of.rb
rubocop-minitest-0.26.1 lib/rubocop/cop/minitest/refute_instance_of.rb
rubocop-minitest-0.26.0 lib/rubocop/cop/minitest/refute_instance_of.rb
rubocop-minitest-0.25.1 lib/rubocop/cop/minitest/refute_instance_of.rb
rubocop-minitest-0.25.0 lib/rubocop/cop/minitest/refute_instance_of.rb
rubocop-minitest-0.24.0 lib/rubocop/cop/minitest/refute_instance_of.rb
rubocop-minitest-0.23.2 lib/rubocop/cop/minitest/refute_instance_of.rb
rubocop-minitest-0.23.1 lib/rubocop/cop/minitest/refute_instance_of.rb
rubocop-minitest-0.23.0 lib/rubocop/cop/minitest/refute_instance_of.rb
rubocop-minitest-0.22.2 lib/rubocop/cop/minitest/refute_instance_of.rb
rubocop-minitest-0.22.1 lib/rubocop/cop/minitest/refute_instance_of.rb
rubocop-minitest-0.22.0 lib/rubocop/cop/minitest/refute_instance_of.rb
rubocop-minitest-0.21.1 lib/rubocop/cop/minitest/refute_instance_of.rb
rubocop-minitest-0.21.0 lib/rubocop/cop/minitest/refute_instance_of.rb
rubocop-minitest-0.20.1 lib/rubocop/cop/minitest/refute_instance_of.rb
rubocop-minitest-0.20.0 lib/rubocop/cop/minitest/refute_instance_of.rb