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

require 'database_cleaner'
require 'factory_girl'
require 'factory_girl_sequences'
require 'spork'
require 'simplecov'

SimpleCov.start

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

require 'synchronisable'

require File.expand_path('../dummy/config/environment', __FILE__)
require 'rspec/rails'

support_pattern   = File.join(File.dirname(__FILE__), 'synchronisable', 'support', '**', '*.rb')
factories_pattern = File.join(File.dirname(__FILE__), 'factories', '**', '*.rb')

Dir[factories_pattern].each { |file| require file }
Dir[support_pattern].each   { |file| require file }

ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)

Spork.prefork do
  RSpec.configure do |config|
    config.treat_symbols_as_metadata_keys_with_true_values = true
    config.run_all_when_everything_filtered = true
    config.filter_run focus: true
    config.order = 'random'
    config.include FactoryGirl::Syntax::Methods

    config.before(:suite) do
      begin
        FactoryGirl.lint
      ensure
        DatabaseCleaner.clean_with(:truncation)
      end
    end

    config.before(:each) { DatabaseCleaner.strategy = :transaction }

    config.before(:each, js: true) do
      DatabaseCleaner.strategy = :truncation
    end

    config.before(:each) { DatabaseCleaner.start }
    config.after(:each)  { DatabaseCleaner.clean }

    if ENV['RUN_SLOW_TESTS'] != 'true'
      config.filter_run_excluding slow: true
    end
  end

  FactoryGirl.define do
    %w(match team player match_player stage tournament).each do |model|
      sequence(:"#{model}_id") { |n| "#{model}_#{n}" }
    end
  end
end

Spork.each_run do
end
<commit_msg>remove deprecated rspec config option: treat_symbols_as_metadata_keys_with_true_values<commit_after>require "codeclimate-test-reporter"
CodeClimate::TestReporter.start

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

require 'database_cleaner'
require 'factory_girl'
require 'factory_girl_sequences'
require 'spork'
require 'simplecov'

SimpleCov.start

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

require 'synchronisable'

require File.expand_path('../dummy/config/environment', __FILE__)
require 'rspec/rails'

support_pattern   = File.join(File.dirname(__FILE__), 'synchronisable', 'support', '**', '*.rb')
factories_pattern = File.join(File.dirname(__FILE__), 'factories', '**', '*.rb')

Dir[factories_pattern].each { |file| require file }
Dir[support_pattern].each   { |file| require file }

ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)

Spork.prefork do
  RSpec.configure do |config|
    config.run_all_when_everything_filtered = true
    config.filter_run focus: true
    config.order = 'random'
    config.include FactoryGirl::Syntax::Methods

    config.before(:suite) do
      begin
        FactoryGirl.lint
      ensure
        DatabaseCleaner.clean_with(:truncation)
      end
    end

    config.before(:each) { DatabaseCleaner.strategy = :transaction }

    config.before(:each, js: true) do
      DatabaseCleaner.strategy = :truncation
    end

    config.before(:each) { DatabaseCleaner.start }
    config.after(:each)  { DatabaseCleaner.clean }

    if ENV['RUN_SLOW_TESTS'] != 'true'
      config.filter_run_excluding slow: true
    end
  end

  FactoryGirl.define do
    %w(match team player match_player stage tournament).each do |model|
      sequence(:"#{model}_id") { |n| "#{model}_#{n}" }
    end
  end
end

Spork.each_run do
end

{'fraction_non_alphanumeric': 0.12614678899082568, 'fraction_numerical': 0.0, 'mean_word_length': 4.359447004608295, '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': '6231832', 'n_tokens_mistral': 1146, 'n_tokens_neox': 1121, 'n_words': 222}