[#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:

Re: Adding startup and shutdown to Test::Unit

From: "Berger, Daniel" <Daniel.Berger@...>
Date: 2008-03-05 18:49:47 UTC
List: ruby-core #15801
> -----Original Message-----
> From: Paul Brannan [mailto:pbrannan@atdesk.com]=20
> Sent: Wednesday, March 05, 2008 11:24 AM
> To: ruby-core@ruby-lang.org
> Subject: Re: Adding startup and shutdown to Test::Unit
>=20
> On Wed, Mar 05, 2008 at 07:52:40AM +0900, Daniel Berger wrote:
> > Hm, something's goofy. I just noticed that instance=20
> variables aren't=20
> > surviving more than one test. Using the applied patches, I=20
> tried this:
>=20
> Test::Unit creates a new instance for every test case run. =20
> When I want the behavior you describe, I use class variables:
>=20
>   class MyTest < Test::Unit::TestCase
>     def setup
>       @@foo ||=3D 42
>     end
>   end

I can live with that for variables, but it won't cut it for other one
time operations. In some of my Ruby core tests, for example, I have
tests where I want to change to a particular directory, execute all the
tests, then change back to the original directory.
=20
> I'm not sure how I feel about your change, because a test=20
> suite can contain instance of multiple test case classes.

Before I looked at the source that's what I thought. That's not how it's
implemented, though. Look at self.suite in testcase.rb. Each *test*
within a given Test::Unit::TestCase itself becomes a
Test::Unit::TestCase object, which is then shoveled into a TestSuite's
@tests instance variable. I find the architecture strange, and difficult
to modify, but it seems to work. I'd have to pick Nathaniel's brain as
to why he did this.

> In that case, which startup/shutdown methods should get called and
when?

The startup and shutdown methods are unique to their test case, so one
doesn't interfere with another. I did a simple check where I had one
file require two other test files that each had a startup and shutdown
method and it works as expected.

In short, Test 1, startup, run tests, shutdown, Test 2, startup, run
tests, shutdown, etc.

Regards,

Dan


This communication is the property of Qwest and may contain confidential =
or
privileged information. Unauthorized use of this communication is =
strictly=20
prohibited and may be unlawful.  If you have received this communication =

in error, please immediately notify the sender by reply e-mail and =
destroy=20
all copies of the communication and any attachments.

In This Thread