diff options
author | John Firebaugh <john_firebaugh@bigfix.com> | 2010-09-24 18:42:01 -0700 |
---|---|---|
committer | John Firebaugh <john_firebaugh@us.ibm.com> | 2010-10-29 15:27:19 -0700 |
commit | 403b06e98ee88b96b6fbd8692f072fdfa7857639 (patch) | |
tree | e3051cd94855c2dd32865ddaaf7b1e0326aca891 /actionpack/test/template | |
parent | 7bbad753e2545a530394f2fe73b7edfef1523ab0 (diff) | |
download | rails-403b06e98ee88b96b6fbd8692f072fdfa7857639.tar.gz rails-403b06e98ee88b96b6fbd8692f072fdfa7857639.tar.bz2 rails-403b06e98ee88b96b6fbd8692f072fdfa7857639.zip |
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.
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/template_error_test.rb | 13 |
1 files changed, 13 insertions, 0 deletions
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 "#<ActionView::Template::Error: original>", error.inspect + end +end |