1 $:.unshift(File.dirname(__FILE__) + '/../lib')
2 RAILS_ROOT = File.dirname(__FILE__)
6 require 'active_record'
7 require 'active_record/fixtures'
8 require "#{File.dirname(__FILE__)}/../init"
11 config = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml'))
12 ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/debug.log")
13 ActiveRecord::Base.establish_connection(config[ENV['DB'] || 'plugin_test'])
15 load(File.dirname(__FILE__) + "/schema.rb") if File.exist?(File.dirname(__FILE__) + "/schema.rb")
17 if ActiveSupport.const_defined?(:TestCase)
18 ActiveSupport::TestCase.send(:include, ActiveRecord::TestFixtures)
19 TEST_CASE = ActiveSupport::TestCase
21 TEST_CASE = Test::Unit::TestCase
24 TEST_CASE.fixture_path = File.dirname(__FILE__) + "/fixtures/"
25 $LOAD_PATH.unshift(TEST_CASE.fixture_path)
27 class TEST_CASE #:nodoc:
28 def create_fixtures(*table_names)
30 Fixtures.create_fixtures(TEST_CASE.fixture_path, table_names) { yield }
32 Fixtures.create_fixtures(TEST_CASE.fixture_path, table_names)
36 self.use_transactional_fixtures = false
38 self.use_instantiated_fixtures = false