Is there an equivalent to RSpec's before(:all) in MiniTest?
- by bergyman
Since it now seems to have replaced TestUnit in 1.9.1, I can't seem to find an equivalent to this. There ARE times when you really just want a method to run once for the suite of tests.
For now I've resorted to some lovely hackery along the lines of:
Class ParseStandardWindTest < MiniTest::Unit::TestCase
@@reader ||= PolicyDataReader.new(Time.now)
@@data ||= @@reader.parse
def test_stuff
transaction = @@data[:transaction]
assert true, transaction
end
end