<commit_before>require 'rbconfig'
require 'cucumber/formatter/unicode'

require 'capybara'
require 'capybara/dsl'
require "capybara/cucumber"

require 'database_cleaner'
require 'database_cleaner/cucumber'

Cucumber::Rails::World.use_transactional_fixtures = false

Capybara.default_driver = :selenium
Capybara.register_driver :selenium do |app|
  Capybara::Selenium::Driver.new(app, :browser => :firefox)
end

DatabaseCleaner.clean_with :truncation
DatabaseCleaner.strategy = :truncation

Before do
  Fixtures.reset_cache
  fixtures_folder = File.join(RAILS_ROOT, 'test', 'fixtures')
  fixtures = ['environments', 'roles']
  Fixtures.create_fixtures(fixtures_folder, fixtures)
  ENV['LANG'] = 'C'
  DatabaseCleaner.start
end

After do
  sleep 2
  DatabaseCleaner.clean
end

World(Capybara)<commit_msg>removing duplicated code<commit_after>Cucumber::Rails::World.use_transactional_fixtures = false

Capybara.default_driver = :selenium
Capybara.register_driver :selenium do |app|
  Capybara::Selenium::Driver.new(app, :browser => :firefox)
end

DatabaseCleaner.clean_with :truncation
DatabaseCleaner.strategy = :truncation

Before do
  DatabaseCleaner.start
end

After do
  DatabaseCleaner.clean
end

World(Capybara)
{'fraction_non_alphanumeric': 0.10123456790123457, 'fraction_numerical': 0.0008230452674897119, 'mean_word_length': 7.052980132450331, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4094031', 'n_tokens_mistral': 434, 'n_tokens_neox': 418, 'n_words': 79}