Before/After Suite when using Ruby MiniTest

Nickolay Kolev picture Nickolay Kolev · May 4, 2011 · Viewed 31.5k times · Source

Is there an alternative to RSpec's before(:suite) and after(:suite) in MiniTest?

I suspect that a custom test runner is in order, however I cannot imagine it is not a common requirement, so somebody has probably implemented in. :-)

Answer

Caley Woods picture Caley Woods · May 4, 2011

There are setup() and teardown() methods available. The documentation also lists before() and after() as being available.

Edit: Are you looking to run something before each test or before or after the whole suite is finished?