繁体   English   中英

有没有办法用guard + guard-rspec强制运行所有规格?

[英]Is there a way to force run all specs with guard + guard-rspec?

是否有类似于autotest的ctrl + c强制运行所有规格? 我还在努力调整我的.Guard文件,但暂时可以强行运行所有规格而不重新启动后卫吗? ctrl + c退出警卫。

马克建议的posix信号不再用于与守卫交互。 有关新的交互方式,请参阅自述文件中标题为“交互”的部分。

要触发每个守卫的run_all方法,只需在守卫终端点击Enter即可。 要触发rspec的run_all方法,请键入rspec并按Enter键。

https://github.com/guard/guard#interactions

当Guard无事可做时,您可以与Guard交互并输入命令。 Guard了解以下命令:

↩: Run all Guards.
h, help: Show a help of the available interactor commands.
r, reload: Reload all Guards.
n, notification: Toggle system notifications on and off.
p, pause: Toggles the file modification listener. The prompt will change to p> when paused. This is useful when switching Git branches, rebase Git or change whitespace.
e, exit: Stop all Guards and quit Guard.

所以,基本上你进入Guard正在运行的终端并按下Enter / return。

可能最简单的方法是使用Spork ,然后简化你的Guardfile:

# Guardfile
guard 'rspec', :version => 2, :cli => '--drb' do # :cli => is important!
  watch(%r{^spec/}) { "spec" }
  watch(%r{^app/}) { "spec" }
  watch('config/routes.rb') { "spec" }
end

specapproutes.rb中的任何内容发生更改时,这将在spec文件夹中运行任何内容,只要您保存它,就会节省大量时间。

使用growl (mac)或libnotify (linux)gem来获取弹出通知。 然后你只需在你的编辑器中编码,每次保存后不久你就会得到一个弹出通过/失败通知。 如果它是一个传递你只是继续编码 - 如果它是一个失败你弹出到终端并检查错误是什么。

暂无
暂无

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

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