2008-01-05 13:32:06 +00:00
|
|
|
require 'abstract_unit'
|
2006-09-03 22:35:31 +00:00
|
|
|
|
|
|
|
class DeprecatedBaseMethodsTest < Test::Unit::TestCase
|
|
|
|
class Target < ActionController::Base
|
|
|
|
def home_url(greeting)
|
|
|
|
"http://example.com/#{greeting}"
|
|
|
|
end
|
|
|
|
|
2006-12-17 08:29:21 +00:00
|
|
|
def raises_name_error
|
|
|
|
this_method_doesnt_exist
|
|
|
|
end
|
|
|
|
|
2006-09-03 22:35:31 +00:00
|
|
|
def rescue_action(e) raise e end
|
|
|
|
end
|
|
|
|
|
|
|
|
def setup
|
|
|
|
@request = ActionController::TestRequest.new
|
|
|
|
@response = ActionController::TestResponse.new
|
|
|
|
@controller = Target.new
|
|
|
|
end
|
|
|
|
|
2006-12-19 23:16:10 +00:00
|
|
|
def test_log_error_silences_deprecation_warnings
|
|
|
|
get :raises_name_error
|
|
|
|
rescue => e
|
|
|
|
assert_not_deprecated { @controller.send :log_error, e }
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_assertion_failed_error_silences_deprecation_warnings
|
2006-12-17 08:29:21 +00:00
|
|
|
get :raises_name_error
|
|
|
|
rescue => e
|
|
|
|
error = Test::Unit::Error.new('testing ur doodz', e)
|
|
|
|
assert_not_deprecated { error.message }
|
|
|
|
end
|
2006-09-03 22:35:31 +00:00
|
|
|
end
|