是否可以在MiniTest中运行一个测试? [英] Is it possible to run a single test in MiniTest?

查看:56
本文介绍了是否可以在MiniTest中运行一个测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用以下命令在一个文件中运行所有测试:

I can run all tests in a single file with:

rake test TEST=path/to/test_file.rb

但是,如果我只想在该文件中运行一个测试,该怎么办?

However, if I want to run just one test in that file, how would I do it?

我正在寻找与以下功能类似的功能:

I'm looking for similar functionality to:

rspec path/to/test_file.rb -l 25

推荐答案

我正在寻找与rspec path/to/file.rb -l 25类似的功能

I'm looking for similar functionality to rspec path/to/file.rb -l 25

是的!使用尼克·夸兰托(Nick Quaranto)的"m"瑰宝.有了它,你可以说:

Yup! Use Nick Quaranto's "m" gem. With it you can say:

m spec/my_spec.rb:25

这篇关于是否可以在MiniTest中运行一个测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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