Sha256: af42325c52b0b399036acc05f68768d7b9b72a2d25e6b462fbe2473326c9eb3c

Contents?: true

Size: 1.18 KB

Versions: 4

Compression:

Stored size: 1.18 KB

Contents

require 'rubygems'
require 'bundler'
Bundler.setup
require 'logger'
require 'active_record'
require 'data_miner'
$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'earth'

require 'support/integration'
include Integration

case ENV['EARTH_DB_ADAPTER']
when 'mysql'
  adapter = 'mysql2'
  database = 'test_earth'
  username = 'root'
  password = 'password'
  
  # system %{mysql -u #{username} -p#{password} -e "DROP DATABASE #{database}"}
  # system %{mysql -u #{username} -p#{password} -e "CREATE DATABASE #{database}"}
else
  adapter = 'postgresql'
  database = 'test_earth'
  username = nil
  password = nil
end

config = {
  'encoding' => 'utf8',
  'adapter' => adapter,
  'database' => database,
}
config['username'] = username if username
config['password'] = password if password

ActiveRecord::Base.establish_connection config

logger = Logger.new 'log/test.log'
logger.level = Logger::DEBUG

ActiveRecord::Base.logger = logger
DataMiner.logger = logger

DataMiner::Run.auto_upgrade!
DataMiner.unit_converter = :conversions

RSpec.configure do |c|
  unless ENV['ALL'] == 'true'
    c.filter_run_excluding :data_miner => true
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
earth-0.12.3 spec/spec_helper.rb
earth-0.12.2 spec/spec_helper.rb
earth-0.12.1 spec/spec_helper.rb
earth-0.12.0 spec/spec_helper.rb