diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-12 08:23:07 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-12 08:23:07 +0000 |
| commit | b404fd712411933f760c2ae394b39065fa41156d (patch) | |
| tree | 3f156491127aa81616adab4e764347f1b28b90d1 | |
| parent | deab3ff8bbf66614894acc4e7a8b2b38e0a15da1 (diff) | |
| download | ruby-b404fd712411933f760c2ae394b39065fa41156d.tar.gz ruby-b404fd712411933f760c2ae394b39065fa41156d.tar.xz ruby-b404fd712411933f760c2ae394b39065fa41156d.zip | |
* lib/test/unit/assertions.rb (assert_nothing_raised): removes the
current trace to get rid of an issue of MiniTest::Unit#location.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 9 | ||||
| -rw-r--r-- | lib/test/unit/assertions.rb | 12 |
2 files changed, 18 insertions, 3 deletions
@@ -1,3 +1,12 @@ +Mon Jan 12 17:23:05 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * lib/test/unit/assertions.rb (assert_nothing_raised): removes the + current trace to get rid of an issue of MiniTest::Unit#location. + +Mon Jan 12 16:49:20 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * instruby.rb (install): erased a garbage. + Mon Jan 12 16:45:28 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> * win32/win32.c (open_dir_handle): extracted from rb_w32_opendir. diff --git a/lib/test/unit/assertions.rb b/lib/test/unit/assertions.rb index c15432f05..ac3ecf93c 100644 --- a/lib/test/unit/assertions.rb +++ b/lib/test/unit/assertions.rb @@ -22,12 +22,18 @@ module Test msg = args.pop end begin - yield + line = __LINE__; yield rescue Exception => e - if ((args.empty? && !e.instance_of?(MiniTest::Assertion)) || + bt = e.backtrace + as = e.instance_of?(MiniTest::Assertion) + if as + ans = /\A#{Regexp.quote(__FILE__)}:#{line}:in /o + bt.reject! {|line| ans =~ line} + end + if ((args.empty? && !as) || args.any? {|a| a.instance_of?(Module) ? e.is_a?(a) : e.class == a }) msg = message(msg) { "Exception raised:\n<#{mu_pp(e)}>" } - raise MiniTest::Assertion, msg.call, e.backtrace + raise MiniTest::Assertion, msg.call, bt else raise end |
