Sha256: 12240cacdd22add8dd4729b26fada0f5b57ed137c4e5afc9c9afd0f8edb15b1c

Contents?: true

Size: 1.04 KB

Versions: 7

Compression:

Stored size: 1.04 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 'logger'
require 'database_cleaner'
require 'goldiloader'
require 'yaml'

FileUtils.makedirs('log')

ActiveRecord::Base.logger = Logger.new('log/test.log')
ActiveRecord::Base.logger.level = Logger::DEBUG
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.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

puts "Testing with ActiveRecord #{ActiveRecord::VERSION::STRING}"

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
goldiloader-0.0.11 spec/spec_helper.rb
goldiloader-0.0.10 spec/spec_helper.rb
goldiloader-0.0.9 spec/spec_helper.rb
goldiloader-0.0.8 spec/spec_helper.rb
goldiloader-0.0.7 spec/spec_helper.rb
goldiloader-0.0.6 spec/spec_helper.rb
goldiloader-0.0.5 spec/spec_helper.rb