Permalink
Browse files

Copy the test_help.rb code in test/test_helper.

Don't attempt to load fixtures: they won't work.  They're tied to ActiveRecord.
  • Loading branch information...
francois committed Oct 17, 2008
1 parent 2005ba9 commit f3d233d4c69a2f35648096d35e48f54b5271896f
Showing with 24 additions and 4 deletions.
  1. +24 −4 test/test_helper.rb
View
@@ -1,6 +1,26 @@
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
-require 'test_help'
+
+require_dependency 'application'
+
+# Make double-sure the RAILS_ENV is set to test,
+# so fixtures are loaded to the right database
+silence_warnings { RAILS_ENV = "test" }
+
+require 'test/unit'
+require 'active_support/test_case'
+require 'action_controller/test_case'
+require 'action_controller/test_process'
+require 'action_controller/integration'
+require 'action_mailer/test_case' if defined?(ActionMailer)
+
+begin
+ require_library_or_gem 'ruby-debug'
+ Debugger.start
+ Debugger.settings[:autoeval] = true if Debugger.respond_to?(:settings)
+rescue LoadError
+ # ruby-debug wasn't available so neither can the debugging be
+end
class Test::Unit::TestCase
# Transactional fixtures accelerate your tests by wrapping each test method
@@ -19,20 +39,20 @@ class Test::Unit::TestCase
# The only drawback to using transactional fixtures is when you actually
# need to test transactions. Since your test is bracketed by a transaction,
# any transactions started in your code will be automatically rolled back.
- self.use_transactional_fixtures = true
+ # self.use_transactional_fixtures = true
# Instantiated fixtures are slow, but give you @david where otherwise you
# would need people(:david). If you don't want to migrate your existing
# test cases which use the @david style and don't mind the speed hit (each
# instantiated fixtures translates to a database query per test method),
# then set this back to true.
- self.use_instantiated_fixtures = false
+ # self.use_instantiated_fixtures = false
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
#
# Note: You'll currently still have to declare fixtures explicitly in integration tests
# -- they do not yet inherit this setting
- fixtures :all
+ # fixtures :all
# Add more helper methods to be used by all tests here...
end

0 comments on commit f3d233d

Please sign in to comment.