Sha256: 40d0934c041cdd0e43ca5a21c36ff212799423713f19dcfb10fe45478c2e1740

Contents?: true

Size: 608 Bytes

Versions: 10

Compression:

Stored size: 608 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module Minitest
      # Enforces the test to use `refute_match`
      # instead of using `refute(matcher.match(string))`.
      #
      # @example
      #   # bad
      #   refute(matcher.match(string))
      #   refute(matcher.match(string), 'message')
      #
      #   # good
      #   refute_match(matcher, string)
      #   refute_match(matcher, string, 'message')
      #
      class RefuteMatch < Base
        extend MinitestCopRule

        define_rule :refute, target_method: :match, inverse: 'regexp_type?'
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rubocop-minitest-0.27.0 lib/rubocop/cop/minitest/refute_match.rb
rubocop-minitest-0.26.1 lib/rubocop/cop/minitest/refute_match.rb
rubocop-minitest-0.26.0 lib/rubocop/cop/minitest/refute_match.rb
rubocop-minitest-0.25.1 lib/rubocop/cop/minitest/refute_match.rb
rubocop-minitest-0.25.0 lib/rubocop/cop/minitest/refute_match.rb
rubocop-minitest-0.24.0 lib/rubocop/cop/minitest/refute_match.rb
rubocop-minitest-0.23.2 lib/rubocop/cop/minitest/refute_match.rb
rubocop-minitest-0.23.1 lib/rubocop/cop/minitest/refute_match.rb
rubocop-minitest-0.23.0 lib/rubocop/cop/minitest/refute_match.rb
rubocop-minitest-0.22.2 lib/rubocop/cop/minitest/refute_match.rb