Hello,
In message "[ruby-talk:19464] RubyUnit: Avoid running setup for every test?"
on 01/08/10, Armin Roehrl <armin / approximity.com> writes:
> 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.
>
> Is there an easy way of doing that?
How about RUNIT::EXT::TestSetup?
require 'runit/ext/testsetup'
class OnlyOnceSetup
include RUNIT::EXT::TestSetup
def setup
... # only once setup about 30 minutes
end
end
class YourTestClass < RUNIT::TestCase
def testA
end
def testB
end
end
RUNIT::CUI::TestRunner.run(OnlyOnceSetup.new(YourTestClass.suite))
Regards,
Masaki Suketa