On Thu, 3 Apr 2003 00:25:37 +0900, Paul Brannan wrote:
> On Wed, Apr 02, 2003 at 04:27:46AM +0900, Phil Tomson wrote:
> Then if I require the file with MyTest but I never run MyTest, I
> still create Foo.

    require 'test/unit'

    class Foo
      def initialize
        puts "In create."
      end
    end

    class MyTest < Test::Unit::TestCase
      def setup
        @@f = Foo.new unless 
self.class.class_variables.include?("@@f")
      end

      def test1
      end

      def test2
      end
    end

This is harder than it should be because @@f ||= Foo.new is not
legal in 1.6.8; perhaps it has been made legal in 1.8?

-austin
-- Austin Ziegler, austin / halostatue.ca on 2003.04.02 at 10:59:58