Sha256: a0d9b22f3810bff5f950b65f8d4b1c4dad5cf5325bf5d2ed6d20943c0d1299fc

Contents?: true

Size: 658 Bytes

Versions: 34

Compression:

Stored size: 658 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module Minitest
      # Enforces the test to use `refute_includes`
      # instead of using `refute(collection.include?(object))`.
      #
      # @example
      #   # bad
      #   refute(collection.include?(object))
      #   refute(collection.include?(object), 'message')
      #
      #   # good
      #   refute_includes(collection, object)
      #   refute_includes(collection, object, 'message')
      #
      class RefuteIncludes < Base
        extend MinitestCopRule

        define_rule :refute, target_method: :include?, preferred_method: :refute_includes
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

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