<commit_before>$:.unshift(File.dirname(__FILE__)) unless
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))

# Matchy should work with either test/unit 
# or minitest
module Matchy
  def self.mu?
    # This needs to be better.
    # How can we decide if we really have a 
    # suite of MiniTest Tests?
    # Rails for example defines MiniTest, so this check for
    # defined?(MiniTest) would be malicious
    defined?(MiniTest)
  end
  def self.assertions_module
    mu? ? MiniTest::Assertions : Test::Unit::Assertions
  end
  def self.test_case_class
    mu? ? MiniTest::Unit::TestCase : Test::Unit::TestCase
  end
end

require 'rubygems'
require 'test/unit' unless Matchy.mu?

require 'matchy/expectation_builder'
require 'matchy/modals'
require 'matchy/version'
require 'matchy/matcher_builder'
require 'matchy/def_matcher'

require 'matchy/built_in/enumerable_expectations'
require 'matchy/built_in/error_expectations'
require 'matchy/built_in/truth_expectations'
require 'matchy/built_in/operator_expectations'
require 'matchy/built_in/change_expectations'


# Evil hack.
# Track the current testcase and 
# provide it to the operator matchers.
Matchy.test_case_class.class_eval do
  alias_method :old_run_method_aliased_by_matchy_300, :run
  def run(whatever, *args, &block)
    $current_test_case = self
    old_run_method_aliased_by_matchy_300(whatever, *args, &block)
  end
end

Matchy.test_case_class.send(:include, Matchy::Expectations::TestCaseExtensions)

include Matchy::DefMatcher

<commit_msg>MiniTest compatible.<commit_after>$:.unshift(File.dirname(__FILE__)) unless
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))

# Matchy should work with either test/unit 
# or minitest

module Matchy
  def self.minitest?
    # This needs to be better.
    # How can we decide if we really have a 
    # suite of MiniTest Tests?
    # Rails for example defines MiniTest, so only check for
    # defined?(MiniTest) would be malicious
    defined?(MiniTest) && 
      defined?(MiniTest::Assertions) && 
        (!defined?(Test::Unit::TestCase) || !(Test::Unit::TestCase < MiniTest::Assertions))
  end
  def self.assertions_module
    minitest? ? MiniTest::Assertions : Test::Unit::Assertions
  end
  def self.test_case_class
    minitest? ? MiniTest::Unit::TestCase : Test::Unit::TestCase
  end
end

require 'rubygems'
require 'test/unit' unless Matchy.minitest?

require 'matchy/expectation_builder'
require 'matchy/modals'
require 'matchy/version'
require 'matchy/matcher_builder'
require 'matchy/def_matcher'

require 'matchy/built_in/enumerable_expectations'
require 'matchy/built_in/error_expectations'
require 'matchy/built_in/truth_expectations'
require 'matchy/built_in/operator_expectations'
require 'matchy/built_in/change_expectations'


# Evil hack.
# Track the current testcase and 
# provide it to the operator matchers.
Matchy.test_case_class.class_eval do
  alias_method :old_run_method_aliased_by_matchy_300, :run
  def run(whatever, *args, &block)
    $current_test_case = self
    old_run_method_aliased_by_matchy_300(whatever, *args, &block)
  end
end

Matchy.test_case_class.send(:include, Matchy::Expectations::TestCaseExtensions)

include Matchy::DefMatcher


{'fraction_non_alphanumeric': 0.10308020738029887, 'fraction_numerical': 0.0036596523330283625, 'mean_word_length': 5.3565891472868215, 'pattern_counts': {'":': 0, '<': 4, '<?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': '7505673', 'n_tokens_mistral': 1103, 'n_tokens_neox': 1080, 'n_words': 247}