diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2005-09-30 01:00:04 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2005-09-30 01:00:04 +0000 |
commit | 4ce9b4c5575cad6f5f1ccd69ddb57d06640e2422 (patch) | |
tree | c5eeaeb8a24b730a8f73ac33776062e5ee549a7f /activerecord/test | |
parent | 093a87d1a32bab3b73fed644040f94a019ad44c1 (diff) | |
download | rails-4ce9b4c5575cad6f5f1ccd69ddb57d06640e2422.tar.gz rails-4ce9b4c5575cad6f5f1ccd69ddb57d06640e2422.tar.bz2 rails-4ce9b4c5575cad6f5f1ccd69ddb57d06640e2422.zip |
Use transactional fixtures by default for AR tests. Set ENV['AR_NO_TX_FIXTURES'] to yes to disable. Tidy up abstract_unit.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2416 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rwxr-xr-x | activerecord/test/abstract_unit.rb | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/activerecord/test/abstract_unit.rb b/activerecord/test/abstract_unit.rb index 34eb92e24c..9373422403 100755 --- a/activerecord/test/abstract_unit.rb +++ b/activerecord/test/abstract_unit.rb @@ -9,16 +9,11 @@ require 'active_support/breakpoint' require 'connection' class Test::Unit::TestCase #:nodoc: - def create_fixtures(*table_names) - if block_given? - Fixtures.create_fixtures(File.dirname(__FILE__) + "/fixtures/", table_names) { yield } - else - Fixtures.create_fixtures(File.dirname(__FILE__) + "/fixtures/", table_names) - end + 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) end end - -Test::Unit::TestCase.fixture_path = File.dirname(__FILE__) + "/fixtures/" -Test::Unit::TestCase.use_instantiated_fixtures = false -Test::Unit::TestCase.use_transactional_fixtures = (ENV['AR_TX_FIXTURES'] == "yes") - |