Sha256: 161364c65ccab0a2c3cb2a0b5e31b13b16c21cc1bc0b4857f19d202e7d1fe28d

Contents?: true

Size: 703 Bytes

Versions: 1

Compression:

Stored size: 703 Bytes

Contents

require 'active_record'
require 'pg'
require 'logger'
require 'fileutils'
require 'database_cleaner'
require 'support/factories'

FileUtils.mkdir_p('log')

config = Travis.config.database.dup
config.merge!('adapter' => 'jdbcpostgresql', 'username' => ENV['USER']) if RUBY_PLATFORM == 'java'

ActiveRecord::Base.logger = Logger.new('log/test.db.log')
ActiveRecord::Base.configurations = { 'test' => config }
ActiveRecord::Base.establish_connection('test')

DatabaseCleaner.strategy = :truncation
DatabaseCleaner.clean_with :truncation

module Support
  module ActiveRecord
    extend ActiveSupport::Concern

    included do
      before :each do
        DatabaseCleaner.clean
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
travis-core-0.0.1 spec/support/active_record.rb