<commit_before>require 'rubygems'
require 'codeclimate-test-reporter'
require 'capybara/poltergeist'

CodeClimate::TestReporter.start

ENV['RAILS_ENV'] ||= 'test'

require 'rails/application'

# Loading more in this block will cause your tests to run faster. However,
# if you change any configuration or code from libraries loaded here, you'll
# need to restart spork for it take effect.
require File.expand_path('../../config/environment', __FILE__)
require 'rspec/rails'

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }

RSpec.configure do |config|
  config.include FactoryGirl::Syntax::Methods
  config.include Capybara::DSL

  # If you're not using ActiveRecord, or you'd prefer not to run each of your
  # examples within a transaction, remove the following line or assign false
  # instead of true.
  config.use_transactional_fixtures = false
  config.use_transactional_examples = false
  config.expose_current_running_example_as :example
  config.infer_spec_type_from_file_location!
  config.filter_rails_from_backtrace!

  config.before(:suite) do
    DatabaseCleaner.clean_with(:truncation)
  end

  config.before(:each) do
    DatabaseCleaner.strategy = if example.metadata[:js]
                                 :truncation
                               else
                                 :transaction
                               end
    DatabaseCleaner.start
  end

  config.after(:each) do
    DatabaseCleaner.clean
  end

  # Clear ActionMailer deliveries after each spec.
  config.after(:each) { ActionMailer::Base.deliveries.clear }
end

  # Don't raise server exceptions in feature specs
  Capybara.raise_server_errors = false
Capybara.register_driver :poltergeist do |app|
  options = {
    phantomjs: Phantomjs.path,
    timeout: 60,
    js_errors: false,
    poltergeist_extensions: [Rails.root.join('spec/support/ga_events_extension.js')]
  }
  Capybara::Poltergeist::Driver.new app, options
end
Capybara.javascript_driver = :poltergeist<commit_msg>style(specs): fix whitespace issues in spec helper<commit_after>require 'rubygems'
require 'codeclimate-test-reporter'
require 'capybara/poltergeist'

CodeClimate::TestReporter.start

ENV['RAILS_ENV'] ||= 'test'

require 'rails/application'

# Loading more in this block will cause your tests to run faster. However,
# if you change any configuration or code from libraries loaded here, you'll
# need to restart spork for it take effect.
require File.expand_path('../../config/environment', __FILE__)
require 'rspec/rails'

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }

RSpec.configure do |config|
  config.include FactoryGirl::Syntax::Methods
  config.include Capybara::DSL

  # If you're not using ActiveRecord, or you'd prefer not to run each of your
  # examples within a transaction, remove the following line or assign false
  # instead of true.
  config.use_transactional_fixtures = false
  config.use_transactional_examples = false
  config.expose_current_running_example_as :example
  config.infer_spec_type_from_file_location!
  config.filter_rails_from_backtrace!

  config.before(:suite) do
    DatabaseCleaner.clean_with(:truncation)
  end

  config.before(:each) do
    DatabaseCleaner.strategy = if example.metadata[:js]
                                 :truncation
                               else
                                 :transaction
                               end
    DatabaseCleaner.start
  end

  config.after(:each) do
    DatabaseCleaner.clean
  end

  # Clear ActionMailer deliveries after each spec.
  config.after(:each) { ActionMailer::Base.deliveries.clear }
end

# Don't raise server exceptions in feature specs
Capybara.raise_server_errors = false

Capybara.register_driver :poltergeist do |app|
  options = {
    phantomjs: Phantomjs.path,
    timeout: 60,
    js_errors: false,
    poltergeist_extensions: [Rails.root.join('spec/support/ga_events_extension.js')]
  }
  Capybara::Poltergeist::Driver.new app, options
end
Capybara.javascript_driver = :poltergeist
{'fraction_non_alphanumeric': 0.08717105263157894, 'fraction_numerical': 0.0009398496240601503, 'mean_word_length': 3.5675965665236054, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5481766', 'n_tokens_mistral': 1295, 'n_tokens_neox': 1239, 'n_words': 339}