From: Brian Candler Date: 2003-04-03T05:48:57+09:00 Subject: Re: sharing objects between tests (revisited?) On Thu, Apr 03, 2003 at 01:22:17AM +0900, Austin Ziegler wrote: > class MyTest < Test::Unit::TestCase > def setup > @@f = Foo.new unless > self.class.class_variables.include?("@@f") > end Or shorter: "unless defined? @@f" It's a shame that you can't do @@f ||= Foo.new as this generates a hard error (but I really must get round to installing a 1.8 preview so I can see if that's changed) Regards, Brian.