<commit_before>require 'simplecov'
SimpleCov.start

$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'lanyon'

require 'fakefs/spec_helpers'

RSpec.configure do |config|
  config.include FakeFS::SpecHelpers, fakefs: true
end

require 'fileutils'

def fakegit(repo_dir, &block)
  source_repo = File.join(__dir__, 'testrepo')
  test_repo = repo_dir # File.join(__dir__, "rspec_repo.#{Time.now.to_i}")
  test_repo_git_dir = File.join(test_repo, '.git')

  FileUtils.mkdir_p(test_repo_git_dir)
  FileUtils.cp_r(File.join(source_repo, '.'), test_repo_git_dir)

  yield if block_given?

  FileUtils.rm_r(test_repo)
end

ENV['RACK_ENV'] = 'test'

require 'rack/test'

RSpec.configure do |config|
  config.include Rack::Test::Methods, rackup: true
end<commit_msg>Improving rack testing methods<commit_after>require 'simplecov'
SimpleCov.start

$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'lanyon'

require 'fakefs/spec_helpers'

RSpec.configure do |config|
  config.include FakeFS::SpecHelpers, fakefs: true
end

require 'fileutils'

def fakegit(repo_dir, &block)
  source_repo = File.join(__dir__, 'testrepo')
  test_repo = repo_dir
  test_repo_git_dir = File.join(test_repo, '.git')

  FileUtils.mkdir_p(test_repo_git_dir)
  FileUtils.cp_r(File.join(source_repo, '.'), test_repo_git_dir)

  yield if block_given?

  FileUtils.rm_r(test_repo)
end

ENV['RACK_ENV'] = 'test'

require 'rack/test'

module Rack::Test::Methods
  def app
    Lanyon::Application
  end
end

RSpec.configure do |config|
  config.include Rack::Test::Methods, rackup: true
end
{'fraction_non_alphanumeric': 0.12950094756790903, 'fraction_numerical': 0.0, 'mean_word_length': 5.572614107883817, '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': '7277926', 'n_tokens_mistral': 603, 'n_tokens_neox': 592, 'n_words': 113}