/vendor/plugins/betternestedset/test/abstract_unit.rb
https://bitbucket.org/Wgaffa/forum · Ruby · 25 lines · 21 code · 4 blank · 0 comment · 2 complexity · dc4f334224fda192ec226d29176889d8 MD5 · raw file
- ENV['RAILS_ENV'] = 'test'
- require File.expand_path(File.join(File.dirname(__FILE__), '../../../../config/environment.rb'))
- require 'test_help'
- config = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml'))
- ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + '/debug.log')
- cs = ActiveRecord::Base.establish_connection(config[ENV['DB'] || 'mysql'])
- puts "Using #{cs.config[:adapter]} adapter"
- load(File.dirname(__FILE__) + '/schema.rb')
- Test::Unit::TestCase.fixture_path = File.dirname(__FILE__) + '/fixtures/'
- $LOAD_PATH.unshift(Test::Unit::TestCase.fixture_path)
- class Test::Unit::TestCase #:nodoc:
- def create_fixtures(*table_names)
- if block_given?
- Fixtures.create_fixtures(Test::Unit::TestCase.fixture_path, table_names) { yield }
- else
- Fixtures.create_fixtures(Test::Unit::TestCase.fixture_path, table_names)
- end
- end
- self.use_transactional_fixtures = true
- self.use_instantiated_fixtures = false
- end