Sha256: ed81ac242a054365c4971afc8c8fdc7ca4cd09f2a1401d3a277669c3d61b8efb
Contents?: true
Size: 1.06 KB
Versions: 4
Compression:
Stored size: 1.06 KB
Contents
$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' require 'simplecov' SimpleCov.start 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') db = ENV['DB'] || 'sqlite3' if db != 'sqlite3' ActiveRecord::Base.establish_connection config[db].merge(database: nil) begin ActiveRecord::Base.connection.drop_database config[db][:database] rescue => e puts e end begin ActiveRecord::Base.connection.create_database config[db][:database], charset: 'utf8' rescue => e puts e end end ActiveRecord::Base.establish_connection config[db] 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.9.1 | test/test_helper.rb |
activerecord-time-0.9.0 | test/test_helper.rb |
activerecord-time-0.8.0 | test/test_helper.rb |
activerecord-time-0.7.0 | test/test_helper.rb |