<commit_before>ENV['RAILS_ENV'] ||= 'test'
ENV['REQUISITION_MAILER_ACCOUNT'] ||= '<EMAIL>'
ENV['REQUISITION_BUILDER_EMAIL'] ||= '<EMAIL>'

if ENV['CI'] == 'true'
  Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new
else
  Minitest::Reporters.use! Minitest::Reporters::ProgressReporter.new
end

if ENV['NO_COVERAGE'] != '1'
  require 'simplecov'
  require 'coveralls'

  if ENV['CIRCLE_ARTIFACTS']
    dir = File.join('..', '..', '..', ENV['CIRCLE_ARTIFACTS'], 'coverage')
    SimpleCov.coverage_dir(dir)
  end

  SimpleCov.formatter = Coveralls::SimpleCov::Formatter
  SimpleCov.start do
    command_name "requisition_#{ENV['CIRCLE_BUILD_NUM']}_#{ENV['CIRCLE_NODE_INDEX']}"

    add_group 'Models', 'app/models'
    add_group 'Controllers', 'app/controllers'
    add_group 'Helpers', 'app/helpers'
    add_group 'Policies', 'app/policies'
    add_group 'Configuration', 'config/'
    add_group 'Libraries', 'lib/'
    add_group 'Test Files', 'test/'

    add_group 'Long files' do |src_file|
      src_file.lines.count > 250
    end

    # get rid of bundled rails/ruby code
    add_filter 'vendor/bundle'

    # make sure we get all results since our tests can take a while
    merge_timeout 60 * 30
  end
end

require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'

module ActiveSupport
  class TestCase
    # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
    #
    # Note: You'll currently still have to declare fixtures explicitly in integration tests
    # -- they do not yet inherit this setting
    fixtures :all

    # Add more helper methods to be used by all tests here...
    def setup
      Rails.cache.clear
    end
  end
end

module ActionController
  class TestCase
    # use the devise test helpers for controller tests
    include Devise::TestHelpers

    def teardown
      switch_login nil
      super<commit_msg>fixed uninitialized constant error when running a single test<commit_after>ENV['RAILS_ENV'] ||= 'test'
ENV['REQUISITION_MAILER_ACCOUNT'] ||= '<EMAIL>'
ENV['REQUISITION_BUILDER_EMAIL'] ||= '<EMAIL>'

require File.expand_path('../../config/environment', __FILE__)

if ENV['CI'] == 'true'
  Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new
else
  Minitest::Reporters.use! Minitest::Reporters::ProgressReporter.new
end

if ENV['NO_COVERAGE'] != '1'
  require 'simplecov'
  require 'coveralls'

  if ENV['CIRCLE_ARTIFACTS']
    dir = File.join('..', '..', '..', ENV['CIRCLE_ARTIFACTS'], 'coverage')
    SimpleCov.coverage_dir(dir)
  end

  SimpleCov.formatter = Coveralls::SimpleCov::Formatter
  SimpleCov.start do
    command_name "requisition_#{ENV['CIRCLE_BUILD_NUM']}_#{ENV['CIRCLE_NODE_INDEX']}"

    add_group 'Models', 'app/models'
    add_group 'Controllers', 'app/controllers'
    add_group 'Helpers', 'app/helpers'
    add_group 'Policies', 'app/policies'
    add_group 'Configuration', 'config/'
    add_group 'Libraries', 'lib/'
    add_group 'Test Files', 'test/'

    add_group 'Long files' do |src_file|
      src_file.lines.count > 250
    end

    # get rid of bundled rails/ruby code
    add_filter 'vendor/bundle'

    # make sure we get all results since our tests can take a while
    merge_timeout 60 * 30
  end
end

require 'rails/test_help'

module ActiveSupport
  class TestCase
    # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
    #
    # Note: You'll currently still have to declare fixtures explicitly in integration tests
    # -- they do not yet inherit this setting
    fixtures :all

    # Add more helper methods to be used by all tests here...
    def setup
      Rails.cache.clear
    end
  end
end

module ActionController
  class TestCase
    # use the devise test helpers for controller tests
    include Devise::TestHelpers

    def teardown
      switch_login nil
      super
{'fraction_non_alphanumeric': 0.11521570653577887, 'fraction_numerical': 0.0041332988891759235, 'mean_word_length': 3.7567567567567566, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '1314537', 'n_tokens_mistral': 1305, 'n_tokens_neox': 1267, 'n_words': 345}