On Sep 2, 2006, at 11:43 PM, Tanaka Akira wrote:

> In article <622DAC7E-55DB-4854-B82B-A037CE9C75EF / segment7.net>,
>   Eric Hodel <drbrain / segment7.net> writes:
>
>> What about Timeout::Error?
>
> Oops.  It seems that the class hierarchy is not appropriate
> to classify them for unit test.

Index: lib/test/unit/testcase.rb
===================================================================
RCS file: /src/ruby/lib/test/unit/testcase.rb,v
retrieving revision 1.7
diff -p -u -r1.7 testcase.rb
--- lib/test/unit/testcase.rb   4 Aug 2006 18:05:45 -0000       1.7
+++ lib/test/unit/testcase.rb   3 Sep 2006 07:17:55 -0000
@@ -70,14 +70,20 @@ module Test
            __send__(@method_name)
          rescue AssertionFailedError => e
            add_failure(e.message, e.backtrace)
-        rescue StandardError, ScriptError
+        rescue SignalException
+          raise unless Timeout::Error === $!
+          add_error($!)
+        rescue Exception
            add_error($!)
          ensure
            begin
              teardown
            rescue AssertionFailedError => e
              add_failure(e.message, e.backtrace)
-          rescue StandardError, ScriptError
+          rescue SignalException
+            raise unless Timeout::Error === $!
+            add_error($!)
+          rescue Exception
              add_error($!)
            end
          end


-- 
Eric Hodel - drbrain / segment7.net - http://blog.segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com