<commit_before>module RSpec
  module Core
    class Example
      def inspect
        ret = RSpec.configuration.reporter.report(1) do |r|
          self.run ExampleGroup.new, r
        end
        RSpec.reset
        ret
      end
    end
  end
end<commit_msg>monkey patches for RSpec in order to automatically report after matching<commit_after>module RSpec
  module Matchers
    class OperatorMatcher
      def eval_match_with_reporting(actual, operator, expected)
        InteractiveRspec.report begin
          eval_match_without_reporting(actual, operator, expected)
        rescue RSpec::Expectations::ExpectationNotMetError => err
          err
        end
      end
      alias_method :eval_match_without_reporting, :eval_match
      alias_method :eval_match, :eval_match_with_reporting
    end
  end

  module Expectations
    class PositiveExpectationHandler
      class << self
        unless method_defined? :handle_matcher_with_reporting
          def handle_matcher_with_reporting(actual, matcher, message=nil, &block)
            begin
              result = handle_matcher_without_reporting actual, matcher, message, &block
              if result.class == TrueClass
                InteractiveRspec.report result
              else
                result
              end
            rescue RSpec::Expectations::ExpectationNotMetError => err
              InteractiveRspec.report err
              false
            end
          end

          alias_method :handle_matcher_without_reporting, :handle_matcher
          alias_method :handle_matcher, :handle_matcher_with_reporting
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.04398289554062309, 'fraction_numerical': 0.0006108735491753207, 'mean_word_length': 2.25, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7444277', 'n_tokens_mistral': 431, 'n_tokens_neox': 417, 'n_words': 108}