简体   繁体   English

如何获得自动测试以在失败后继续运行规格而不停止?

[英]How can I get autotest to keep running my specs after failures without stopping?

This seems like a very bizarre problem and believe me I've done a lot of searching before posing the question here. 这似乎是一个非常奇怪的问题,相信我在这里提出问题之前已经做了很多搜索。 I am using the latest version of Rails 3 and Rspec 2 with Ruby 1.9.2, and I can't get autotest to run my specs properly when they fail. 我正在使用带Ruby 1.9.2的最新版本的Rails 3和Rspec 2,并且在它们失败时无法自动测试以正确运行我的规范。

When all of my specs pass, it works great; 当我所有的规格通过时,它就很好了。 as soon as I make a change, the specs re-run and all is well. 一旦做出更改,规格就会重新运行,一切都很好。

When I have a spec failure, autotest halts instead of waiting for me to make another change. 如果规格出现故障,请自动停止测试,而不必等待我进行其他更改。 So it sort of defeats the whole purpose of autotest - my tests go red and I don't get to make them green again unless I manually run autotest again. 因此,这有悖于自动测试的全部目的-我的测试变成红色,除非再次手动运行自动测试,否则我不会再次变成绿色。

请您查看链接http://ph7spot.com/musings/getting-started-with-autotest以确保您没有错过任何内容。

You can use : 您可以使用 :

find . 找 。 -cmin -1 -cmin -1

to check what changed in the last minute, or run 检查最后一分钟发生了什么变化或运行

autotest -v 自动测试-v

to have the log of what triggering the rerun. 记录触发重新运行的原因。

After that, just ignore the offensive files by editing the .autotest file in the root of your project, for example : 之后,只需在项目根目录中编辑.autotest文件即可忽略攻击性文件,例如:

Autotest.add_hook :initialize do |autotest|
  %w{.git .svn .hg .DS_Store ._* vendor tmp log doc solr}.each do |exception|
    autotest.add_exception(exception)
  end
end

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM