From: Armin Roehrl <armin / approximity.com>
Subject: [ruby-talk:19464] RubyUnit: Avoid running setup for every test?
Date: Fri, 10 Aug 2001 08:28:56 +0900

> Hi,
> 
>   I'm using Rubyunit on code where I would like to have setup executed
> only once and not for every test. Why? The setup requires about 30 minutes,
> but its required to have executed once for the tests.

I guess someone call tell you a smarter solution, but maybe
following simple workaround is just good enough.  The setup is
execute once when the code is loaded.

  def expensive_setup
    "expensive setup"
  end
      
  class MyTest < RUNIT::TestCase
    EXPENSIVE_SETUP_RESULT = expensive_setup

    def setup
      @fixture = EXPENSIVE_SETUP_RESULT
    end
  end

Best Regards,
Kenichi Komiya.