<commit_before>module MiniTest
  module Matchers
    module ActiveModel
      class ValidationMatcher # :nodoc:
        def initialize attr, type
          @attr = attr
          @type  = type
        end

        def matches? subject
          @klass     = subject.is_a?(Class) ? subject : subject.class
          @validator = @klass.validators_on(@attr).find { |v| v.kind == @type }
          @result    = true

          check_validator

          @result
        end

        def failure_message
          "Expected #{@klass} to #{description}; instead got #{@negative_message}"
        end

        def negative_failure_message
          "Expected #{@klass} to not #{description}; instead got #{@positive_message}"
        end

        private

        def description
          "validate #{@type} of #{@attr}"
        end

        def check_validator
          if @validator
            @positive_message = "#{@type} validator for #{@attr}"
          else
            @negative_message = "no #{@type} validator for #{@attr}"
            @result = false
          end<commit_msg>fix failing test with negative message<commit_after>module MiniTest
  module Matchers
    module ActiveModel
      class ValidationMatcher # :nodoc:
        def initialize attr, type
          @attr = attr
          @type  = type
        end

        def matches? subject
          @klass     = subject.is_a?(Class) ? subject : subject.class
          @validator = @klass.validators_on(@attr).find { |v| v.kind == @type }
          @result    = true

          check_validator

          @result
        end

        def failure_message
          "Expected #{@klass} to #{description}; instead got #{@negative_message}"
        end

        def negative_failure_message
          "Expected #{@klass} to not #{description}; instead got #{@positive_message}"
        end

        private

        def description
          "validate #{@type} of #{@attr}"
        end

        def check_validator
          if @validator
            @positive_message = "#{@type} validator for #{@attr}"
            @negative_message = "#{@type} validator for #{@attr}"
          else
            @negative_message = "no #{@type} validator for #{@attr}"
            @result = false
          end
{'fraction_non_alphanumeric': 0.09827357237715803, 'fraction_numerical': 0.0, 'mean_word_length': 1.803970223325062, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5739083', 'n_tokens_mistral': 591, 'n_tokens_neox': 586, 'n_words': 175}