Sha256: 07ade035cc3322dc94c476513c3bcfabe4c6ac0983d9d5943ba026d6f1b3dd60

Contents?: true

Size: 1.65 KB

Versions: 14

Compression:

Stored size: 1.65 KB

Contents

require "codeclimate-test-reporter"
CodeClimate::TestReporter.start

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

require 'database_cleaner'
require 'factory_girl'
require 'factory_girl_sequences'

if ENV['COVERAGE']
  require 'simplecov'
  SimpleCov.start
end

if ENV['TRAVIS']
  require 'coveralls'
  Coveralls.wear!
end

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

require 'synchronisable'

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

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)

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(remote match team player match_player stage tournament).each do |prefix|
    sequence(:"#{prefix}_id") { |n| "#{prefix}_#{n}" }
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
synchronisable-1.2.7 spec/spec_helper.rb
synchronisable-1.2.6 spec/spec_helper.rb
synchronisable-1.2.5 spec/spec_helper.rb
synchronisable-1.2.4 spec/spec_helper.rb
synchronisable-1.2.3 spec/spec_helper.rb
synchronisable-1.2.2 spec/spec_helper.rb
synchronisable-1.2.1 spec/spec_helper.rb
synchronisable-1.2.0 spec/spec_helper.rb
synchronisable-1.1.9 spec/spec_helper.rb
synchronisable-1.1.8 spec/spec_helper.rb
synchronisable-1.1.7 spec/spec_helper.rb
synchronisable-1.1.6 spec/spec_helper.rb
synchronisable-1.1.5 spec/spec_helper.rb
synchronisable-1.1.4 spec/spec_helper.rb