Permalink
Browse files

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
  • Loading branch information...
1 parent 093a87d commit 4ce9b4c5575cad6f5f1ccd69ddb57d06640e2422 @jeremy jeremy committed Sep 30, 2005
Showing with 6 additions and 11 deletions.
  1. +6 −11 activerecord/test/abstract_unit.rb
View
17 activerecord/test/abstract_unit.rb
@@ -9,16 +9,11 @@
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")
-

0 comments on commit 4ce9b4c

Please sign in to comment.