我将如何在 minitest 中做相当于 rspec before(:all) 的操作。我有一组测试需要永远运行,但如果我不必在每次测试之前设置数据库,它会非常快。
我想做的是:
before(:all) do
config.transactional_fixtures = false
DatabaseCleaner.start
end
......
# block of 6 tests in their own describe block.
......
after(:all) do
config.transactional_fixtures = true
DatabaseCleaner.clean
end