2004-11-23 20:04:44 -05:00
|
|
|
$:.unshift(File.dirname(__FILE__) + '/../lib')
|
2005-11-13 06:13:11 -05:00
|
|
|
$:.unshift(File.dirname(__FILE__) + '/../../activesupport/lib/active_support')
|
2005-04-17 02:16:00 -04:00
|
|
|
$:.unshift(File.dirname(__FILE__) + '/fixtures/helpers')
|
2004-11-23 20:04:44 -05:00
|
|
|
|
2006-03-05 13:59:58 -05:00
|
|
|
require 'yaml'
|
2007-05-15 17:36:21 -04:00
|
|
|
require 'stringio'
|
2004-11-23 20:04:44 -05:00
|
|
|
require 'test/unit'
|
|
|
|
require 'action_controller'
|
2007-05-15 17:36:21 -04:00
|
|
|
require 'action_controller/cgi_ext'
|
2004-11-23 20:04:44 -05:00
|
|
|
require 'action_controller/test_process'
|
|
|
|
|
2007-05-27 20:00:07 -04:00
|
|
|
begin
|
|
|
|
require 'ruby-debug'
|
|
|
|
rescue LoadError
|
|
|
|
# Debugging disabled. `gem install ruby-debug` to enable.
|
|
|
|
end
|
2007-05-27 12:38:02 -04:00
|
|
|
|
2006-09-03 23:38:13 -04:00
|
|
|
# Show backtraces for deprecated behavior for quicker cleanup.
|
|
|
|
ActiveSupport::Deprecation.debug = true
|
|
|
|
|
2004-11-23 20:04:44 -05:00
|
|
|
ActionController::Base.logger = nil
|
2005-07-21 03:14:35 -04:00
|
|
|
ActionController::Base.ignore_missing_templates = false
|
2006-09-03 23:38:13 -04:00
|
|
|
ActionController::Routing::Routes.reload rescue nil
|
2007-01-14 07:49:55 -05:00
|
|
|
|
|
|
|
|
|
|
|
# Wrap tests that use Mocha and skip if unavailable.
|
|
|
|
def uses_mocha(test_name)
|
2007-04-01 18:29:19 -04:00
|
|
|
unless Object.const_defined?(:Mocha)
|
|
|
|
require 'mocha'
|
|
|
|
require 'stubba'
|
|
|
|
end
|
2007-01-14 07:49:55 -05:00
|
|
|
yield
|
2007-09-25 21:24:07 -04:00
|
|
|
rescue LoadError => load_error
|
|
|
|
raise unless load_error.message =~ /mocha/i
|
2007-01-14 07:49:55 -05:00
|
|
|
$stderr.puts "Skipping #{test_name} tests. `gem install mocha` and try again."
|
|
|
|
end
|