有没有办法强制运行所有规范与防护 +守卫-rspec?

发布于 2024-11-27 06:29:12 字数 98 浏览 3 评论 0原文

有没有类似于自动测试的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

坦然微笑 2024-12-04 06:29:12

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's run_all method, type rspec and hit enter.

对不⑦ 2024-12-04 06:29:12

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

您可以与 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。

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:

↩: 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.

So, basically you go into the terminal where Guard is running and hit enter/return.

你另情深 2024-12-04 06:29:12

也许最简单的事情就是使用 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

这将运行spec 文件夹,当 specapproutes.rb 中的任何内容发生更改时,只要保存即可,并且将为您节省大量 时间。

使用 growl (mac) 或 libnotify (linux) gems 获取弹出通知。然后,您只需在编辑器中进行编码,每次保存后不久,您都会收到弹出的通过/失败通知。如果通过了,你就继续编码——如果失败了,你会跳到终端并检查错误是什么。

Probably the easiest thing to do is use Spork, then simplify your 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

This will run anything in the spec folder when anything in the spec, app, or routes.rb changes, as soon as you save it, and will save you a ton of time.

Use the growl (mac) or libnotify (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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文