[#15707] Schedule for the 1.8.7 release — "Akinori MUSHA" <knu@...>

Hi, developers,

21 messages 2008/03/01

[#15740] Copy-on-write friendly garbage collector — Hongli Lai <hongli@...99.net>

Hi.

31 messages 2008/03/03
[#15742] Re: Copy-on-write friendly garbage collector — Yukihiro Matsumoto <matz@...> 2008/03/03

Hi,

[#15829] Re: Copy-on-write friendly garbage collector — Daniel DeLorme <dan-ml@...42.com> 2008/03/08

Yukihiro Matsumoto wrote:

[#15756] embedding Ruby 1.9.0 inside pthread — "Suraj Kurapati" <sunaku@...>

Hello,

18 messages 2008/03/03
[#15759] Re: embedding Ruby 1.9.0 inside pthread — Nobuyoshi Nakada <nobu@...> 2008/03/04

Hi,

[#15760] Re: embedding Ruby 1.9.0 inside pthread — Yukihiro Matsumoto <matz@...> 2008/03/04

Hi,

[#15762] Re: embedding Ruby 1.9.0 inside pthread — "Suraj N. Kurapati" <sunaku@...> 2008/03/04

Yukihiro Matsumoto wrote:

[#15783] Adding startup and shutdown to Test::Unit — Daniel Berger <Daniel.Berger@...>

Hi all,

15 messages 2008/03/04

[#15835] TimeoutError in core, timeouts for ConditionVariable#wait — MenTaLguY <mental@...>

I've been reworking JRuby's stdlib to improve performance and fix

10 messages 2008/03/09

[#15990] Recent changes in Range#step behavior — "Vladimir Sizikov" <vsizikov@...>

Hi,

35 messages 2008/03/23
[#15991] Re: Recent changes in Range#step behavior — Dave Thomas <dave@...> 2008/03/23

[#15993] Re: Recent changes in Range#step behavior — "Vladimir Sizikov" <vsizikov@...> 2008/03/23

Hi Dave,

[#15997] Re: Recent changes in Range#step behavior — Dave Thomas <dave@...> 2008/03/23

[#16024] Re: Recent changes in Range#step behavior — "Vladimir Sizikov" <vsizikov@...> 2008/03/26

Hi Dave,

[#16025] Re: Recent changes in Range#step behavior — Yukihiro Matsumoto <matz@...> 2008/03/26

Hi,

[#16026] Re: Recent changes in Range#step behavior — Dave Thomas <dave@...> 2008/03/26

[#16027] Re: Recent changes in Range#step behavior — Yukihiro Matsumoto <matz@...> 2008/03/26

Hi,

[#16029] Re: Recent changes in Range#step behavior — Dave Thomas <dave@...> 2008/03/26

[#16030] Re: Recent changes in Range#step behavior — Yukihiro Matsumoto <matz@...> 2008/03/26

Hi,

[#16031] Re: Recent changes in Range#step behavior — Dave Thomas <dave@...> 2008/03/26

[#16032] Re: Recent changes in Range#step behavior — "Vladimir Sizikov" <vsizikov@...> 2008/03/26

On Wed, Mar 26, 2008 at 7:01 PM, Dave Thomas <dave@pragprog.com> wrote:

[#16033] Re: Recent changes in Range#step behavior — Dave Thomas <dave@...> 2008/03/26

[#16041] Re: Recent changes in Range#step behavior — David Flanagan <david@...> 2008/03/26

Dave Thomas wrote:

Adding startup and shutdown to Test::Unit

From: Daniel Berger <Daniel.Berger@...>
Date: 2008-03-04 22:32:36 UTC
List: ruby-core #15783
Hi all,

Here are two patches that add startup and shutdown methods to 
Test::Unit. Unlike setup and teardown, they run once per test suite, not 
per test.

Regards,

Dan

--- testcase.orig       Tue Mar  4 14:33:21 2008
+++ testcase.rb Tue Mar  4 14:38:10 2008
@@ -95,6 +95,16 @@
          yield(FINISHED, name)
        end

+      # Called once before each test suite is run. Can be used for one time
+      # set up of fixture information.
+      def startup
+      end
+
+      # Called once after the test suite runs. Can be used for one time
+      # clean up up of fixture information.
+      def shutdown
+      end
+
        # Called before every test method runs. Can be used
        # to set up fixture information.
        def setup

--- testsuite.orig      Tue Mar  4 14:33:28 2008
+++ testsuite.rb        Tue Mar  4 14:34:04 2008
@@ -30,9 +30,33 @@
        # TestSuite.
        def run(result, &progress_block)
          yield(STARTED, name)
-        @tests.each do |test|
+
+        @tests.each_with_index do |test, index|
+          begin
+            if index == 0 && test.respond_to?(:startup)
+               test.startup
+            end
+          rescue Exception
+            if Test::Unit::TestCase::PASSTHROUGH_EXCEPTIONS.include? 
$!.class
+               raise
+            end
+            test.send(:add_error, $!) # Private method
+          end
+
            test.run(result, &progress_block)
+
+          begin
+            if index == @tests.length - 1 && test.respond_to?(:shutdown)
+               test.shutdown
+            end
+          rescue Exception
+            if Test::Unit::TestCase::PASSTHROUGH_EXCEPTIONS.include? 
$!.class
+               raise
+            end
+            test.send(:add_error, $!) # Private method
+          end
          end
+
          yield(FINISHED, name)
        end

In This Thread

Prev Next