<commit_before>ENV['RAILS_ENV'] = 'test'

require 'simplecov' if ENV["COVERAGE"] == "true"

Dir["#{File.expand_path('../step_definitions', __dir__)}/*.rb"].each do |f|
  require f
end

require_relative "../../spec/rails/rails-#{Gem.loaded_specs["rails"].version}/config/environment"

require_relative 'rails'

require 'rspec/mocks'
World(RSpec::Mocks::ExampleMethods)

Around do |scenario, block|
  RSpec::Mocks.setup

  block.call

  begin
    RSpec::Mocks.verify
  ensure
    RSpec::Mocks.teardown
  end
end

After '@debug' do |scenario|
  # :nocov:
  save_and_open_page if scenario.failed?
  # :nocov:
end

require 'capybara/rails'
require 'capybara/cucumber'
require 'capybara/session'

Capybara.register_driver :chrome do |app|
  Capybara::Selenium::Driver.load_selenium

  options = Selenium::WebDriver::Chrome::Options.new
  options.args << '--headless'

  http_client = Selenium::WebDriver::Remote::Http::Default.new
  http_client.read_timeout = 180

  Capybara::Selenium::Driver.new(app, browser: :chrome, options: options, http_client: http_client)
end

Capybara.javascript_driver = :chrome

Capybara.server = :webrick

Capybara.asset_host = 'http://localhost:3000'

# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
# order to ease the transition to Capybara we set the default here. If you'd
# prefer to use XPath just remove this line and adjust any selectors in your
# steps to use the XPath syntax.
Capybara.default_selector = :css

# Database resetting strategy
DatabaseCleaner.strategy = :truncation
Cucumber::Rails::Database.javascript_strategy = :truncation<commit_msg>Remove unnecessary requires<commit_after>ENV['RAILS_ENV'] = 'test'

require 'simplecov' if ENV["COVERAGE"] == "true"

Dir["#{File.expand_path('../step_definitions', __dir__)}/*.rb"].each do |f|
  require f
end

require_relative "../../spec/rails/rails-#{Gem.loaded_specs["rails"].version}/config/environment"

require_relative 'rails'

require 'rspec/mocks'
World(RSpec::Mocks::ExampleMethods)

Around do |scenario, block|
  RSpec::Mocks.setup

  block.call

  begin
    RSpec::Mocks.verify
  ensure
    RSpec::Mocks.teardown
  end
end

After '@debug' do |scenario|
  # :nocov:
  save_and_open_page if scenario.failed?
  # :nocov:
end

require 'capybara/cucumber'

Capybara.register_driver :chrome do |app|
  Capybara::Selenium::Driver.load_selenium

  options = Selenium::WebDriver::Chrome::Options.new
  options.args << '--headless'

  http_client = Selenium::WebDriver::Remote::Http::Default.new
  http_client.read_timeout = 180

  Capybara::Selenium::Driver.new(app, browser: :chrome, options: options, http_client: http_client)
end

Capybara.javascript_driver = :chrome

Capybara.server = :webrick

Capybara.asset_host = 'http://localhost:3000'

# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
# order to ease the transition to Capybara we set the default here. If you'd
# prefer to use XPath just remove this line and adjust any selectors in your
# steps to use the XPath syntax.
Capybara.default_selector = :css

# Database resetting strategy
DatabaseCleaner.strategy = :truncation
Cucumber::Rails::Database.javascript_strategy = :truncation
{'fraction_non_alphanumeric': 0.12132582864290181, 'fraction_numerical': 0.0050031269543464665, 'mean_word_length': 5.3096646942800785, 'pattern_counts': {'":': 0, '<': 7, '<?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': '6238439', 'n_tokens_mistral': 1118, 'n_tokens_neox': 1078, 'n_words': 259}