Sha256: cc03c00aa420d313e5a5165ba69814c7a589f615b149b6d69068cf9e4bfaf487

Contents?: true

Size: 589 Bytes

Versions: 10

Compression:

Stored size: 589 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module Minitest
      # This cop enforces the test to use `assert_match`
      # instead of using `assert(matcher.match(string))`.
      #
      # @example
      #   # bad
      #   assert(matcher.match(string))
      #   assert(matcher.match(string), 'message')
      #
      #   # good
      #   assert_match(regex, string)
      #   assert_match(matcher, string, 'message')
      #
      class AssertMatch < Cop
        extend MinitestCopRule

        define_rule :assert, target_method: :match
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rubocop-minitest-0.11.1 lib/rubocop/cop/minitest/assert_match.rb
rubocop-minitest-0.11.0 lib/rubocop/cop/minitest/assert_match.rb
rubocop-minitest-0.10.3 lib/rubocop/cop/minitest/assert_match.rb
rubocop-minitest-0.10.2 lib/rubocop/cop/minitest/assert_match.rb
rubocop-minitest-0.10.1 lib/rubocop/cop/minitest/assert_match.rb
rubocop-minitest-0.10.0 lib/rubocop/cop/minitest/assert_match.rb
rubocop-minitest-0.9.0 lib/rubocop/cop/minitest/assert_match.rb
rubocop-minitest-0.8.1 lib/rubocop/cop/minitest/assert_match.rb
rubocop-minitest-0.8.0 lib/rubocop/cop/minitest/assert_match.rb
rubocop-minitest-0.7.0 lib/rubocop/cop/minitest/assert_match.rb