X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/baf9ff0ec39c13f52ee8d4f087641dc5fcc9c53b..fcc68b4dc198b7cb0cf93467d96038b0844675fe:/vendor/plugins/geokit/test/test_helper.rb diff --git a/vendor/plugins/geokit/test/test_helper.rb b/vendor/plugins/geokit/test/test_helper.rb new file mode 100644 index 0000000..5cd8f92 --- /dev/null +++ b/vendor/plugins/geokit/test/test_helper.rb @@ -0,0 +1,18 @@ +require 'test/unit' + +plugin_test_dir = File.dirname(__FILE__) + +# Load the Rails environment +require File.join(plugin_test_dir, '../../../../config/environment') +require 'active_record/fixtures' +databases = YAML::load(IO.read(plugin_test_dir + '/database.yml')) +ActiveRecord::Base.logger = Logger.new(plugin_test_dir + "/debug.log") + +# A specific database can be used by setting the DB environment variable +ActiveRecord::Base.establish_connection(databases[ENV['DB'] || 'mysql']) + +# Load the test schema into the database +load(File.join(plugin_test_dir, 'schema.rb')) + +# Load fixtures from the plugin +Test::Unit::TestCase.fixture_path = File.join(plugin_test_dir, 'fixtures/') \ No newline at end of file