2004-12-13 18:47:27 -05:00
|
|
|
$:.unshift(File.dirname(__FILE__) + '/../lib')
|
2005-02-17 14:28:13 -05:00
|
|
|
$:.unshift(File.dirname(__FILE__) + '/../../activesupport/lib')
|
2004-11-23 20:04:44 -05:00
|
|
|
|
|
|
|
require 'test/unit'
|
|
|
|
require 'active_record'
|
|
|
|
require 'active_record/fixtures'
|
2005-02-15 10:57:44 -05:00
|
|
|
require 'active_support/binding_of_caller'
|
|
|
|
require 'active_support/breakpoint'
|
2004-11-23 20:04:44 -05:00
|
|
|
require 'connection'
|
|
|
|
|
2005-11-16 03:16:54 -05:00
|
|
|
QUOTED_TYPE = ActiveRecord::Base.connection.quote_column_name('type') unless Object.const_defined?(:QUOTED_TYPE)
|
|
|
|
|
2004-11-23 20:04:44 -05:00
|
|
|
class Test::Unit::TestCase #:nodoc:
|
2005-09-29 21:00:04 -04:00
|
|
|
self.fixture_path = File.dirname(__FILE__) + "/fixtures/"
|
|
|
|
self.use_instantiated_fixtures = false
|
|
|
|
self.use_transactional_fixtures = (ENV['AR_NO_TX_FIXTURES'] != "yes")
|
|
|
|
|
|
|
|
def create_fixtures(*table_names, &block)
|
|
|
|
Fixtures.create_fixtures(File.dirname(__FILE__) + "/fixtures/", table_names, &block)
|
2004-11-23 20:04:44 -05:00
|
|
|
end
|
|
|
|
end
|
2005-10-27 04:18:41 -04:00
|
|
|
|
|
|
|
def current_adapter?(type)
|
|
|
|
ActiveRecord::ConnectionAdapters.const_defined?(type) &&
|
|
|
|
ActiveRecord::Base.connection.instance_of?(ActiveRecord::ConnectionAdapters.const_get(type))
|
|
|
|
end
|
2005-11-19 04:53:36 -05:00
|
|
|
|
|
|
|
#ActiveRecord::Base.logger = Logger.new(STDOUT)
|
|
|
|
#ActiveRecord::Base.colorize_logging = false
|