使用Ruby MiniTest时的Suite之前/之后 [英] Before/After Suite when using Ruby MiniTest

查看:81
本文介绍了使用Ruby MiniTest时的Suite之前/之后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MiniTest中是否有RSpec的before(:suite)after(:suite)的替代方案?

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. :-)

推荐答案

setup()teardown()方法可用.该文档还列出了before()after()可用.

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

您是要在每次测试之前还是在整个套件完成之前或之后运行某些内容?

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

这篇关于使用Ruby MiniTest时的Suite之前/之后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆