aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorNicholas Seckar <nseckar@gmail.com>2005-10-16 17:47:19 +0000
committerNicholas Seckar <nseckar@gmail.com>2005-10-16 17:47:19 +0000
commit57f43473d73906232340ccbb6b4651dfd99bc1eb (patch)
tree8e8b2ab6fe0a9835aff822031e64076287e5b72f /activesupport/test
parent98c1735f0313a08563d8cb92fcbff48b2be906fc (diff)
downloadrails-57f43473d73906232340ccbb6b4651dfd99bc1eb.tar.gz
rails-57f43473d73906232340ccbb6b4651dfd99bc1eb.tar.bz2
rails-57f43473d73906232340ccbb6b4651dfd99bc1eb.zip
Update Exception extension to show the first few framework frames in an application trace.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2654 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/core_ext/exception_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/exception_test.rb b/activesupport/test/core_ext/exception_test.rb
index 69990d4715..7f5e64bc9f 100644
--- a/activesupport/test/core_ext/exception_test.rb
+++ b/activesupport/test/core_ext/exception_test.rb
@@ -21,4 +21,18 @@ class ExceptionExtTests < Test::Unit::TestCase
assert_equal ['bhal.rb', 'rawh hid den stuff is not here', 'almost all'], e.clean_backtrace
end
+ def test_app_backtrace
+ Exception::TraceSubstitutions << [/\s*hidden.*/, '']
+ e = get_exception RuntimeError, 'RAWR', ['bhal.rb', ' vendor/file.rb some stuff', 'almost all']
+ assert_kind_of Exception, e
+ assert_equal ['bhal.rb', 'almost all'], e.application_backtrace
+ end
+
+ def test_app_backtrace_with_before
+ Exception::TraceSubstitutions << [/\s*hidden.*/, '']
+ e = get_exception RuntimeError, 'RAWR', ['vendor/file.rb some stuff', 'bhal.rb', ' vendor/file.rb some stuff', 'almost all']
+ assert_kind_of Exception, e
+ assert_equal ['vendor/file.rb some stuff', 'bhal.rb', 'almost all'], e.application_backtrace
+ end
+
end \ No newline at end of file