有没有办法强制运行所有规范与防护 +守卫-rspec?
有没有类似于自动测试的 ctrl+c 来强制运行所有规范?我仍在努力微调我的 .Guardfile,但目前我可以在不重新启动防护的情况下强制运行所有规范吗? ctrl+c 退出守卫。
Is there something similar to autotest's ctrl+c to force run all specs? I'm still working to fine tune my .Guardfile, but for the time being can I force run all specs without restarting guard? ctrl+c quits guard.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Mark 建议的 posix 信号不再用于与守卫交互。请参阅 README 中标题为“交互”的部分,了解新的交互方式。
要触发每个守卫的
run_all
方法,只需在守卫终端中按 Enter 键即可。要触发 rspec 的 run_all 方法,请输入 rspec 并按 Enter 键。The posix signals that Mark suggests are no longer used to interact with guard. See the section titled "Interactions" in the README for the new way to interact.
To trigger each guard's
run_all
method, just hit enter in the guard terminal. To trigger rspec'srun_all
method, typerspec
and hit enter.https://github.com/guard/guard#interactions
您可以与 Guard 交互并输入命令当警卫无事可做时。 Guard 理解以下命令:
因此,基本上您进入 Guard 运行的终端并按 Enter/Return。
https://github.com/guard/guard#interactions
You can interact with Guard and enter commands when Guard has nothing to do. Guard understands the following commands:
So, basically you go into the terminal where Guard is running and hit enter/return.
也许最简单的事情就是使用 Spork,然后简化你的 Guardfile:
这将运行
spec
文件夹,当spec
、app
或routes.rb
中的任何内容发生更改时,只要保存即可,并且将为您节省大量 时间。使用
growl
(mac) 或libnotify
(linux) gems 获取弹出通知。然后,您只需在编辑器中进行编码,每次保存后不久,您都会收到弹出的通过/失败通知。如果通过了,你就继续编码——如果失败了,你会跳到终端并检查错误是什么。Probably the easiest thing to do is use Spork, then simplify your Guardfile:
This will run anything in the
spec
folder when anything in thespec
,app
, orroutes.rb
changes, as soon as you save it, and will save you a ton of time.Use the
growl
(mac) orlibnotify
(linux) gems to get pop-up notifications. Then you just code in your editor, and shortly after each save you'll get a pop-up pass / fail notification. If it's a pass you just keep on coding -- if it's a fail you pop over to the terminal and check out what the error is.