Ruby 自动测试的热键
除了重新运行所有规范的 Ctrl+C 之外,最好对自动测试有更多的控制。
在我的 Rails 3 项目中使用自动测试时,我经常发现自己在等待某些规范完成,因为自动测试总是在某个规范失败的任何文件中重新运行所有规范(例如 user_spec.rb 被完全执行,而不仅仅是一个失败的规范)。是否有任何键盘快捷键可以告诉自动测试仅运行所有文件中失败的规范?或者也许是某种交互模式,您可以告诉自动测试仅执行一个特定文件(有时重构时许多规范会被破坏,我会逐个文件地修复它们以保持理智)。
如果这不存在,是否有充分的理由?我知道整个规范套件应该经常运行,并且上述执行模式不会这样做,但恕我直言,这确实有助于更快地修复个别规范。
It would be nice to have some more control over autotest besides Ctrl+C
, which reruns all specs.
When using autotest within my Rails 3 project I often find myself waiting for some specs to finish, as autotest is always rerunning all specs in any file where one spec failed (e.g. user_spec.rb
is executed completely and not only the one failing spec). Is there any keyboard shortcut to tell autotest to only run the specs that failed in all files? Or maybe some kind of interactive mode where you can tell autotest to execute only one specific file (sometimes many specs break when refactoring and I fix them file by file to stay sane).
If this doesn't exist, is there a good reason for it? I know that the whole spec suite should be run frequently and the above execution modes wouldn't do this, but IMHO this would really help in fixing individual specs quicker.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论