Sha256: 71cbf54b495a893c16a5b1a24a5e8b7139f76d630dca31fba4dd71a478b2b3a1
Contents?: true
Size: 1.27 KB
Versions: 5
Compression:
Stored size: 1.27 KB
Contents
# encoding: UTF-8 require 'simplecov' require 'coveralls' SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ SimpleCov::Formatter::HTMLFormatter, Coveralls::SimpleCov::Formatter ] SimpleCov.start do add_filter 'spec' end require 'database_cleaner' require 'delayed_job_groups_plugin' require 'yaml' require 'timecop' spec_dir = File.dirname(__FILE__) Dir["#{spec_dir}/support/**/*.rb"].sort.each { |f| require f } FileUtils.makedirs('log') Delayed::Worker.read_ahead = 1 Delayed::Worker.destroy_failed_jobs = false Delayed::Worker.logger = Logger.new('log/test.log') Delayed::Worker.logger.level = Logger::DEBUG ActiveRecord::Base.logger = Delayed::Worker.logger ActiveRecord::Migration.verbose = false db_adapter = ENV.fetch('ADAPTER', 'sqlite3') config = YAML.load(File.read('spec/db/database.yml')) ActiveRecord::Base.establish_connection(config[db_adapter]) require 'db/schema' RSpec.configure do |config| config.treat_symbols_as_metadata_keys_with_true_values = true config.order = 'random' config.before(:suite) do DatabaseCleaner.clean_with(:truncation) end config.before(:each) do DatabaseCleaner.strategy = :transaction end config.before(:each) do DatabaseCleaner.start end config.after(:each) do DatabaseCleaner.clean end end
Version data entries
5 entries across 5 versions & 1 rubygems