diff options
author | Nicholas Seckar <nseckar@gmail.com> | 2006-04-04 19:37:29 +0000 |
---|---|---|
committer | Nicholas Seckar <nseckar@gmail.com> | 2006-04-04 19:37:29 +0000 |
commit | e714b25723b674bb6d66af40ea9047166907616b (patch) | |
tree | 757a0368a8cef19d5c951d68162ea73dabb6edaa /activesupport/test/core_ext/exception_test.rb | |
parent | 62dc792a484e6e62fb2fb87fd47819144c5e3301 (diff) | |
download | rails-e714b25723b674bb6d66af40ea9047166907616b.tar.gz rails-e714b25723b674bb6d66af40ea9047166907616b.tar.bz2 rails-e714b25723b674bb6d66af40ea9047166907616b.zip |
Update the diagnostics template skip the useless '<controller not set>' text.
Fix symbol extensions test case.
Clean paths inside of exception messages and traces.
Add Pathname.clean_within for cleaning all the paths inside of a string.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4158 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/core_ext/exception_test.rb')
-rw-r--r-- | activesupport/test/core_ext/exception_test.rb | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/activesupport/test/core_ext/exception_test.rb b/activesupport/test/core_ext/exception_test.rb index 58f1ba5540..9b7afb1913 100644 --- a/activesupport/test/core_ext/exception_test.rb +++ b/activesupport/test/core_ext/exception_test.rb @@ -41,6 +41,25 @@ class ExceptionExtTests < Test::Unit::TestCase assert_kind_of Exception, e assert_equal ['vendor/file.rb some stuff', ' vendor/file.rb some stuff'], e.framework_backtrace end - -end
\ No newline at end of file + def test_backtrace_should_clean_paths + Exception::TraceSubstitutions << [/\s*hidden.*/, ''] + e = get_exception RuntimeError, 'RAWR', ['a/b/c/../d/../../../bhal.rb', 'rawh hid den stuff is not here', 'almost all'] + assert_kind_of Exception, e + assert_equal ['bhal.rb', 'rawh hid den stuff is not here', 'almost all'], e.clean_backtrace + end + + def test_clean_message_should_clean_paths + Exception::TraceSubstitutions << [/\s*hidden.*/, ''] + e = get_exception RuntimeError, "I dislike a/z/x/../../b/y/../c", ['a/b/c/../d/../../../bhal.rb', 'rawh hid den stuff is not here', 'almost all'] + assert_kind_of Exception, e + assert_equal "I dislike a/b/c", e.clean_message + end + + def test_app_trace_should_be_empty_when_no_app_frames + Exception::TraceSubstitutions << [/\s*hidden.*/, ''] + e = get_exception RuntimeError, 'RAWR', ['vendor/file.rb some stuff', 'generated/bhal.rb', ' vendor/file.rb some stuff', 'generated/almost all'] + assert_kind_of Exception, e + assert_equal [], e.application_backtrace + end +end |