在Minitest中无法使用Globbing-仅运行一个文件 [英] Globbing doesn't work with Minitest - Only one file is run

查看:51
本文介绍了在Minitest中无法使用Globbing-仅运行一个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将所有规格放置在specs/*.rb中.

I have placed all my specs in specs/*.rb.

但是,当我使用ruby spec/**/*_spec.rb运行Minitest时,仅运行一个文件.

However, when I run Minitest with ruby spec/**/*_spec.rb, only one file is run.

有什么作用?

推荐答案

这不是针对minitest的,而是针对Ruby的.您正在有效地运行一个ruby程序,该程序对正在运行的程序一无所知.

This is not minitest specific, but Ruby. You are effectively running a ruby program which knows nothing about the program being run.

Ruby不支持afaik一次运行多个文件,因此,如果要获得类似的结果,可以尝试以下操作:

Ruby does not support running multiple files at once afaik, so if you want to get a similar result you could try something like:

for file in spec/**/*_spec.rb; do ruby $file; done

更新:对于您想要的内容,您应该按照

UPDATE: for what you want you should probably create a Rake task as described here

这篇关于在Minitest中无法使用Globbing-仅运行一个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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