aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/rails-2.0.2/actionpack/test/abstract_unit.rb
diff options
context:
space:
mode:
authorfrancis <francis>2008-01-23 01:48:14 +0000
committerfrancis <francis>2008-01-23 01:48:14 +0000
commit60eaae4f7df1f1dae91defb87d3707451c359cf4 (patch)
treee74835c37779a2f094e810960cda07b99a75330e /vendor/rails-2.0.2/actionpack/test/abstract_unit.rb
parent71d22c740302e1f83bbbd89b229734ea9c67493c (diff)
Freeze in rails 2.0.2 (Am I going to regret having this beast in CVS?)
Diffstat (limited to 'vendor/rails-2.0.2/actionpack/test/abstract_unit.rb')
-rw-r--r--vendor/rails-2.0.2/actionpack/test/abstract_unit.rb36
1 files changed, 36 insertions, 0 deletions
diff --git a/vendor/rails-2.0.2/actionpack/test/abstract_unit.rb b/vendor/rails-2.0.2/actionpack/test/abstract_unit.rb
new file mode 100644
index 000000000..700bc1f5e
--- /dev/null
+++ b/vendor/rails-2.0.2/actionpack/test/abstract_unit.rb
@@ -0,0 +1,36 @@
+$:.unshift(File.dirname(__FILE__) + '/../lib')
+$:.unshift(File.dirname(__FILE__) + '/../../activesupport/lib/active_support')
+$:.unshift(File.dirname(__FILE__) + '/fixtures/helpers')
+
+require 'yaml'
+require 'stringio'
+require 'test/unit'
+require 'action_controller'
+require 'action_controller/cgi_ext'
+require 'action_controller/test_process'
+
+begin
+ require 'ruby-debug'
+rescue LoadError
+ # Debugging disabled. `gem install ruby-debug` to enable.
+end
+
+# Show backtraces for deprecated behavior for quicker cleanup.
+ActiveSupport::Deprecation.debug = true
+
+ActionController::Base.logger = nil
+ActionController::Base.ignore_missing_templates = false
+ActionController::Routing::Routes.reload rescue nil
+
+
+# Wrap tests that use Mocha and skip if unavailable.
+def uses_mocha(test_name)
+ unless Object.const_defined?(:Mocha)
+ require 'mocha'
+ require 'stubba'
+ end
+ yield
+rescue LoadError => load_error
+ raise unless load_error.message =~ /mocha/i
+ $stderr.puts "Skipping #{test_name} tests. `gem install mocha` and try again."
+end