<commit_before>$:.unshift File.expand_path("../..", __FILE__)
$:.unshift File.expand_path("../lib", __FILE__)

# This must be at the top
if ENV["HOMEBREW_TESTS_COVERAGE"]
  require "simplecov"
  SimpleCov.start do
    tests_path = File.dirname(__FILE__)

    minimum_coverage 50
    coverage_dir File.expand_path("#{tests_path}/coverage")
    root File.expand_path("#{tests_path}/..")

    add_filter "Homebrew/test/"
    add_filter "vendor/bundle/"
    add_filter "Homebrew/vendor/"
    add_filter "Homebrew/compat/"
  end
end

require "global"

# Test environment setup
%w{ENV Formula}.each { |d| HOMEBREW_LIBRARY.join(d).mkpath }
%w{cache formula_cache cellar logs}.each { |d| HOMEBREW_PREFIX.parent.join(d).mkpath }

# Test fixtures and files can be found relative to this path
TEST_DIRECTORY = File.dirname(File.expand_path(__FILE__))

begin
  require "rubygems"
  require "minitest/autorun"
  require "mocha/setup"
rescue LoadError
  abort "Run `rake deps` or install the mocha and minitest gems before running the tests"
end

module Homebrew
  module VersionAssertions
    def version v
      Version.new(v)
    end

    def assert_version_equal expected, actual
      assert_equal Version.new(expected), actual
    end

    def assert_version_detected expected, url
      assert_equal expected, Version.parse(url).to_s
    end

    def assert_version_nil url
      assert_nil Version.parse(url)
    end
  end

  module FSLeakLogger
    def self.included(klass)
      require "find"
      @@log = File.open("fs_leak_log", "w")
      klass.make_my_diffs_pretty!
    end
<commit_msg>testing_env: point to `bundle install` now.<commit_after>$:.unshift File.expand_path("../..", __FILE__)
$:.unshift File.expand_path("../lib", __FILE__)

# This must be at the top
if ENV["HOMEBREW_TESTS_COVERAGE"]
  require "simplecov"
  SimpleCov.start do
    tests_path = File.dirname(__FILE__)

    minimum_coverage 50
    coverage_dir File.expand_path("#{tests_path}/coverage")
    root File.expand_path("#{tests_path}/..")

    add_filter "Homebrew/test/"
    add_filter "vendor/bundle/"
    add_filter "Homebrew/vendor/"
    add_filter "Homebrew/compat/"
  end
end

require "global"

# Test environment setup
%w{ENV Formula}.each { |d| HOMEBREW_LIBRARY.join(d).mkpath }
%w{cache formula_cache cellar logs}.each { |d| HOMEBREW_PREFIX.parent.join(d).mkpath }

# Test fixtures and files can be found relative to this path
TEST_DIRECTORY = File.dirname(File.expand_path(__FILE__))

begin
  require "rubygems"
  require "minitest/autorun"
  require "mocha/setup"
rescue LoadError
  abort "Run `bundle install` or install the mocha and minitest gems before running the tests"
end

module Homebrew
  module VersionAssertions
    def version v
      Version.new(v)
    end

    def assert_version_equal expected, actual
      assert_equal Version.new(expected), actual
    end

    def assert_version_detected expected, url
      assert_equal expected, Version.parse(url).to_s
    end

    def assert_version_nil url
      assert_nil Version.parse(url)
    end
  end

  module FSLeakLogger
    def self.included(klass)
      require "find"
      @@log = File.open("fs_leak_log", "w")
      klass.make_my_diffs_pretty!
    end

{'fraction_non_alphanumeric': 0.10090314543755839, 'fraction_numerical': 0.0012457178449081284, 'mean_word_length': 3.7444608567208273, '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': '4134581', 'n_tokens_mistral': 1086, 'n_tokens_neox': 1051, 'n_words': 269}