]> projects.mako.cc - selectricity/blob - vendor/plugins/geokit/test/test_helper.rb
added a little more installation information
[selectricity] / vendor / plugins / geokit / test / test_helper.rb
1 require 'test/unit'
2
3 plugin_test_dir = File.dirname(__FILE__)
4
5 # Load the Rails environment
6 require File.join(plugin_test_dir, '../../../../config/environment')
7 require 'active_record/fixtures'
8 databases = YAML::load(IO.read(plugin_test_dir + '/database.yml'))
9 ActiveRecord::Base.logger = Logger.new(plugin_test_dir + "/debug.log")
10
11 # A specific database can be used by setting the DB environment variable
12 ActiveRecord::Base.establish_connection(databases[ENV['DB'] || 'mysql'])
13
14 # Load the test schema into the database
15 load(File.join(plugin_test_dir, 'schema.rb'))
16
17 # Load fixtures from the plugin
18 Test::Unit::TestCase.fixture_path = File.join(plugin_test_dir, 'fixtures/')

Benjamin Mako Hill || Want to submit a patch?