<commit_before>begin
  require "codeclimate-test-reporter"
  require "simplecov"
  SimpleCov.filters.clear
  SimpleCov.add_filter { |src| !(src.filename =~ /^#{SimpleCov.root}/) unless src.filename =~ /teaspoon/ }
  # filter the framework implementations
  SimpleCov.add_filter("lib/teaspoon-(jasmine|mocha|qunit).rb")
  # filter deprecation warnings, devkit tools, and our teaspoon envs
  SimpleCov.add_filter("teaspoon/deprecated.rb")
  SimpleCov.add_filter("devkit.rb")
  SimpleCov.add_filter("teaspoon_env.rb")
  # filter the controller, since it's tested elsewhere
  SimpleCov.add_filter("suite_controller.rb")
  CodeClimate::TestReporter.start
rescue LoadError
  puts "Not using codeclimate-test-reporter."
end

ENV["RAILS_ENV"] ||= "test"
ENV["RAILS_ROOT"] = File.expand_path("../dummy", __FILE__)
require File.expand_path("../dummy/config/environment", __FILE__)

require "rspec/rails"
require "capybara/rails"

require "fileutils"
require "ostruct"

Dir[File.expand_path("../support/**/*.rb", __FILE__)].each { |f| require f }

RSpec.configure do |config|
  config.order = "random"
  config.include Teaspoon::Devkit
  config.include ExitCodes
  config.include Rack::Test::Methods

  config.before(:each, shell: true) do
    @dirs = [ENV["ARUBA_PATH"]] if ENV["ARUBA_PATH"]
    @aruba_timeout_seconds = 180
    clean_current_dir
  end

  config.after(:each, shell: true) do
    restore_env<commit_msg>use a profile for coverage configuration.<commit_after>begin
  require "codeclimate-test-reporter"
  require "simplecov"
  SimpleCov.profiles.define "teaspoon" do
    filters.clear
    add_filter { |src| !(src.filename =~ /^#{SimpleCov.root}/) unless src.filename =~ /teaspoon/ }
    # filter the framework implementations
    add_filter("lib/teaspoon-(jasmine|mocha|qunit).rb")
    # filter deprecation warnings, devkit tools, and our teaspoon envs
    add_filter("teaspoon/deprecated.rb")
    add_filter("devkit.rb")
    add_filter("teaspoon_env.rb")
    # filter the controller, since it's tested elsewhere
    add_filter("suite_controller.rb")
  end
  CodeClimate::TestReporter.configuration.profile = "teaspoon"
  CodeClimate::TestReporter.start
rescue LoadError
  puts "Not using codeclimate-test-reporter."
end

ENV["RAILS_ENV"] ||= "test"
ENV["RAILS_ROOT"] = File.expand_path("../dummy", __FILE__)
require File.expand_path("../dummy/config/environment", __FILE__)

require "rspec/rails"
require "capybara/rails"

require "fileutils"
require "ostruct"

Dir[File.expand_path("../support/**/*.rb", __FILE__)].each { |f| require f }

RSpec.configure do |config|
  config.order = "random"
  config.include Teaspoon::Devkit
  config.include ExitCodes
  config.include Rack::Test::Methods

  config.before(:each, shell: true) do
    @dirs = [ENV["ARUBA_PATH"]] if ENV["ARUBA_PATH"]
    @aruba_timeout_seconds = 180
    clean_current_dir
  end

  config.after(:each, shell: true) do
    restore_env
{'fraction_non_alphanumeric': 0.13519091847265222, 'fraction_numerical': 0.0020639834881320948, 'mean_word_length': 4.874747474747474, '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': '4697107', 'n_tokens_mistral': 1010, 'n_tokens_neox': 991, 'n_words': 200}