Sha256: ef75fc0b957379afdd9e96ab372bbf6d7130021dcee724c3f100319d044932f1
Contents?: true
Size: 981 Bytes
Versions: 5
Compression:
Stored size: 981 Bytes
Contents
require 'rubygems' require 'active_record' require 'active_record/fixtures' require 'active_support' require 'active_support/test_case' require 'test/unit' require 'shoulda' require 'mocha' require 'redgreen' ENV['RAILS_ENV'] = 'test' #ENV['RAILS_ROOT'] ||= File.dirname(__FILE__) + '/../../../..' #require File.expand_path(File.join(ENV['RAILS_ROOT'], 'config/environment.rb')) def load_schema config = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml')) db_adapter = ENV['DB'] # no db passed, try one of these fine config-free DBs before bombing. db_adapter ||= 'mysql' if db_adapter.nil? raise "No DB Adapter selected. Pass the DB= option to pick one, or install Sqlite or Sqlite3." end ActiveRecord::Base.establish_connection(config[db_adapter]) #Fixtures.create_fixtures(File.dirname(__FILE__), ActiveRecord::Base.connection.tables) load(File.dirname(__FILE__) + "/schema.rb") require File.dirname(__FILE__) + '/../rails/init.rb' end
Version data entries
5 entries across 5 versions & 1 rubygems