如何使用minitest运行所有测试? [英] How to run all tests with minitest?

查看:80
本文介绍了如何使用minitest运行所有测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了一个项目的源代码,发现了一个错误,并进行了修复.

I downloaded source code for a project, found a bug, and fixed it.

现在,我想运行测试以找出是否损坏了任何东西.

Now I want to run tests to find out if I have broken anything.

测试是在最小的DSL中进行的.

The Tests are in minitest DSL.

我如何一次运行它们?

我搜索了适用的耙任务等,但未找到任何内容.

I searched for applicable rake tasks etc, but I didn't find any.

推荐答案

此处是页面上有一个示例可以帮助您入门.
我将发布我现在正在使用的另一个宝石:

There is an example in the page to get you started.
I'll post another one that I'm using right now for a gem:

require 'rake/testtask'

Rake::TestTask.new do |t|
  t.pattern = "spec/*_spec.rb"
end

如您所见,我假设我的文件都在/lib中,并且我的规格都在/spec中,并且命名为whatever_spec.rb

As you can see, I assume that my files are all in /lib and that my specs are in /spec and are named whatever_spec.rb

希望有帮助.

这篇关于如何使用minitest运行所有测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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