【发布时间】:2015-12-20 00:21:19
【问题描述】:
如何使用 minitest 5 运行套件级设置和拆卸(在所有测试运行之前和之后)?我正在尝试复制为 rails 3 编写的自定义测试运行器的功能,目前将其升级到 rails 4。
这可能看起来是 Ruby Minitest: Suite- or Class- level setup? 的副本,但 .runner 的功能在 minitest 5.0+ 中已被弃用
例如,我希望这些在所有测试之前和之后运行。
def before_suites
# code to run before the first test
p "Before everything"
end
def after_suites
# code to run after the last test
p "After everything"
end
【问题讨论】:
标签: ruby-on-rails ruby minitest