Sha256: 56fddc00e72aa88341bfbd2b348c2221968af99d7aebd377b3aa3bed540fab6d
Contents?: true
Size: 758 Bytes
Versions: 8
Compression:
Stored size: 758 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop module Minitest # Enforces the test to use `assert_match` # instead of using `assert(matcher.match(string))`. # # @example # # bad # assert(matcher.match(string)) # assert(matcher.match?(string)) # assert(matcher =~ string) # assert(matcher.match(string), 'message') # # # good # assert_match(regex, string) # assert_match(matcher, string, 'message') # class AssertMatch < Base extend MinitestCopRule define_rule :assert, target_method: %i[match match? =~], preferred_method: :assert_match, inverse: 'regexp_type?' end end end end
Version data entries
8 entries across 8 versions & 1 rubygems