1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionpack/test/template/template_error_test.rb
John Firebaugh 403b06e98e Ensure original exception message is present in both Template::Error#message and Template::Error#inspect.
Previously, #inspect would produce #<ActionView::Template::Error: ActionView::Template::Error>, which is not very useful.
2010-10-29 15:27:19 -07:00

13 lines
448 B
Ruby

require "abstract_unit"
class TemplateErrorTest < ActiveSupport::TestCase
def test_provides_original_message
error = ActionView::Template::Error.new("test", {}, Exception.new("original"))
assert_equal "original", error.message
end
def test_provides_useful_inspect
error = ActionView::Template::Error.new("test", {}, Exception.new("original"))
assert_equal "#<ActionView::Template::Error: original>", error.inspect
end
end