Before/After Suite when using Ruby MiniTest

前端 未结 8 1045
时光说笑
时光说笑 2020-12-09 07:30

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

8条回答
  •  [愿得一人]
    2020-12-09 08:07

    To get this to work with the current version of Minitest (5.0.6) you need to require 'minitest' and use Minitest.after_run { ... }.

    warn "MiniTest::Unit.after_tests is now Minitest.after_run. ..."
    

    https://github.com/seattlerb/minitest/blob/master/lib/minitest.rb https://github.com/seattlerb/minitest/blob/master/lib/minitest/unit.rb

提交回复
热议问题