diff options
| author | ntalbott <ntalbott@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-09-19 02:48:46 +0000 |
|---|---|---|
| committer | ntalbott <ntalbott@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-09-19 02:48:46 +0000 |
| commit | ba51a267716363f1a69632f040ab01da0bbde78e (patch) | |
| tree | 715b07f7eccd87ad19acb59d51494d85b759fb66 /test/testunit/test_error.rb | |
| parent | 9fb55fa783bf276e3eebaf04d99ef77902d50e0e (diff) | |
| download | ruby-ba51a267716363f1a69632f040ab01da0bbde78e.tar.gz ruby-ba51a267716363f1a69632f040ab01da0bbde78e.tar.xz ruby-ba51a267716363f1a69632f040ab01da0bbde78e.zip | |
* test/testunit/*: Added.
* lib/test/unit.rb: Documentation update.
* lib/test/unit/ui/console/testrunner.rb (TestRunner#initialize):
Ditto.
* lib/test/unit.rb: Factored out an ObjectSpace collector.
* lib/test/unit/collector/objectspace.rb: Ditto.
* sample/testunit/*: Added.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/testunit/test_error.rb')
| -rw-r--r-- | test/testunit/test_error.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/testunit/test_error.rb b/test/testunit/test_error.rb new file mode 100644 index 000000000..c95bef38c --- /dev/null +++ b/test/testunit/test_error.rb @@ -0,0 +1,30 @@ +# Author:: Nathaniel Talbott. +# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved. +# License:: Ruby license. + +require 'test/unit/error' + +module Test + module Unit + class TC_Error < TestCase + def setup + @old_load_path = $:.dup + $:.replace(['C:\some\old\path']) + end + + def test_backtrace_filtering + backtrace = [%q{tc_thing.rb:4:in '/'}] + + backtrace.concat([%q{tc_thing.rb:4:in 'test_stuff'}, + %q{C:\some\old\path/test/unit/testcase.rb:44:in 'send'}, + %q{C:\some\old\path\test\unit\testcase.rb:44:in 'run'}, + %q{tc_thing.rb:3}]) + assert_equal([backtrace[0..1], backtrace[-1]].flatten, Error.filter(backtrace), "Should filter out all TestUnit-specific lines") + end + + def teardown + $:.replace(@old_load_path) + end + end + end +end |
