Sha256: b001bb6e5f1bedf5864786b3e31b7d37a437bb027046e1604bd65f6907c0ef7a

Contents?: true

Size: 1.23 KB

Versions: 4

Compression:

Stored size: 1.23 KB

Contents

# frozen_string_literal: true

$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../lib')
RAILS_ROOT = File.dirname(__FILE__)

require 'rubygems'
require 'bundler/setup'
require 'minitest/autorun'
require 'minitest/reporters'
MiniTest::Reporters.use!

require 'active_record'
require 'activerecord-time'
require 'logger'
require 'fileutils'
require 'yaml'

if defined?(Rake) && (RUBY_ENGINE != 'jruby' || org.jruby.RubyInstanceConfig.FULL_TRACE_ENABLED)
  require 'simplecov'
  SimpleCov.start
end

FileUtils.rm_rf File.expand_path(':memory:', File.dirname(__FILE__))
config = YAML.load(IO.read(File.dirname(__FILE__) + '/database.yml'))
ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + '/test.log')
adapter = ENV['ADAPTER'] || 'sqlite3'
if adapter != 'sqlite3'
  ActiveRecord::Base.establish_connection config[adapter].merge(database: nil)
  begin
    ActiveRecord::Base.connection.drop_database config[adapter][:database]
  rescue => e
    puts e
  end
  begin
    ActiveRecord::Base.connection.create_database config[adapter][:database], charset: 'utf8'
  rescue => e
    puts e
  end
end
ActiveRecord::Base.establish_connection config[adapter]
load(File.dirname(__FILE__) + '/schema.rb') if File.exist?(File.dirname(__FILE__) + '/schema.rb')

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
activerecord-time-0.17.0 test/test_helper.rb
activerecord-time-0.16.0 test/test_helper.rb
activerecord-time-0.15.0 test/test_helper.rb
activerecord-time-0.14.0 test/test_helper.rb