From 403b06e98ee88b96b6fbd8692f072fdfa7857639 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 24 Sep 2010 18:42:01 -0700 Subject: Ensure original exception message is present in both Template::Error#message and Template::Error#inspect. Previously, #inspect would produce #, which is not very useful. --- actionpack/test/template/template_error_test.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 actionpack/test/template/template_error_test.rb (limited to 'actionpack/test') diff --git a/actionpack/test/template/template_error_test.rb b/actionpack/test/template/template_error_test.rb new file mode 100644 index 0000000000..3a874082d9 --- /dev/null +++ b/actionpack/test/template/template_error_test.rb @@ -0,0 +1,13 @@ +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 "#", error.inspect + end +end -- cgit v1.2.3