Skip to content
This repository
Browse code

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...
commit 4ce9b4c5575cad6f5f1ccd69ddb57d06640e2422 1 parent 093a87d
Jeremy Kemper authored September 30, 2005

Showing 1 changed file with 6 additions and 11 deletions. Show diff stats Hide diff stats

  1. 17  activerecord/test/abstract_unit.rb
17  activerecord/test/abstract_unit.rb
@@ -9,16 +9,11 @@
9 9
 require 'connection'
10 10
 
11 11
 class Test::Unit::TestCase #:nodoc:
12  
-  def create_fixtures(*table_names)
13  
-    if block_given?
14  
-      Fixtures.create_fixtures(File.dirname(__FILE__) + "/fixtures/", table_names) { yield }
15  
-    else
16  
-      Fixtures.create_fixtures(File.dirname(__FILE__) + "/fixtures/", table_names)
17  
-    end
  12
+  self.fixture_path = File.dirname(__FILE__) + "/fixtures/"
  13
+  self.use_instantiated_fixtures = false
  14
+  self.use_transactional_fixtures = (ENV['AR_NO_TX_FIXTURES'] != "yes")
  15
+
  16
+  def create_fixtures(*table_names, &block)
  17
+    Fixtures.create_fixtures(File.dirname(__FILE__) + "/fixtures/", table_names, &block)
18 18
   end
19 19
 end
20  
-
21  
-Test::Unit::TestCase.fixture_path = File.dirname(__FILE__) + "/fixtures/"
22  
-Test::Unit::TestCase.use_instantiated_fixtures = false
23  
-Test::Unit::TestCase.use_transactional_fixtures = (ENV['AR_TX_FIXTURES'] == "yes")
24  
-

0 notes on commit 4ce9b4c

Please sign in to comment.
Something went wrong with that request. Please try again.