[前][次][番号順一覧][スレッド一覧]

ruby-changes:9908

From: nobu <ko1@a...>
Date: Mon, 12 Jan 2009 17:23:24 +0900 (JST)
Subject: [ruby-changes:9908] Ruby:r21449 (trunk): * lib/test/unit/assertions.rb (assert_nothing_raised): removes the

nobu	2009-01-12 17:23:07 +0900 (Mon, 12 Jan 2009)

  New Revision: 21449

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=21449

  Log:
    * lib/test/unit/assertions.rb (assert_nothing_raised): removes the
      current trace to get rid of an issue of MiniTest::Unit#location.

  Modified files:
    trunk/ChangeLog
    trunk/lib/test/unit/assertions.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 21448)
+++ ChangeLog	(revision 21449)
@@ -1,3 +1,12 @@
+Mon Jan 12 17:23:05 2009  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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@r...>
+
+	* instruby.rb (install): erased a garbage.
+
 Mon Jan 12 16:45:28 2009  Nobuyoshi Nakada  <nobu@r...>
 
 	* win32/win32.c (open_dir_handle): extracted from rb_w32_opendir.
Index: lib/test/unit/assertions.rb
===================================================================
--- lib/test/unit/assertions.rb	(revision 21448)
+++ lib/test/unit/assertions.rb	(revision 21449)
@@ -22,12 +22,18 @@
           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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]