2010-09-24 21:42:01 -04:00
|
|
|
require "abstract_unit"
|
|
|
|
|
|
|
|
class TemplateErrorTest < ActiveSupport::TestCase
|
|
|
|
def test_provides_original_message
|
2012-01-20 11:13:29 -05:00
|
|
|
error = ActionView::Template::Error.new("test", Exception.new("original"))
|
2010-09-24 21:42:01 -04:00
|
|
|
assert_equal "original", error.message
|
|
|
|
end
|
|
|
|
|
2013-10-30 11:48:09 -04:00
|
|
|
def test_provides_original_backtrace
|
|
|
|
original_exception = Exception.new
|
|
|
|
original_exception.set_backtrace(%W[ foo bar baz ])
|
|
|
|
error = ActionView::Template::Error.new("test", original_exception)
|
|
|
|
assert_equal %W[ foo bar baz ], error.backtrace
|
|
|
|
end
|
|
|
|
|
2010-09-24 21:42:01 -04:00
|
|
|
def test_provides_useful_inspect
|
2012-01-20 11:13:29 -05:00
|
|
|
error = ActionView::Template::Error.new("test", Exception.new("original"))
|
2010-09-24 21:42:01 -04:00
|
|
|
assert_equal "#<ActionView::Template::Error: original>", error.inspect
|
|
|
|
end
|
|
|
|
end
|