添加自定义目录(源和规范)以在 Rails 3 项目中进行自动测试
我有一个 Rails 3 应用程序,它使用 RSpec2 作为我的测试框架,并且我能够使用自动测试来观察我的模型和规范目录的更改,并在文件更改时重新运行我的规范套件。
我想添加一个目录,其中包含一些自定义类(RAILS_ROOT/lib/some_project/lib/.rb)及其相应的规范(RAILS_ROOT/spec/some_project/_spec.rb),以便自动测试将自动获取对所有这些文件的更改并根据需要重新运行。
如何进行自动测试以查看其他目录中的这些文件?我怀疑我必须向 RAILS_ROOT/autotest/discover.rb 添加一些内容,但我不确定该怎么做。
I have a Rails 3 app that uses RSpec2 as my testing framework, and I'm able to use autotest to watch my model and spec directories for changes and re-run my spec suite when files change.
I'd like to add a directory with some custom classes in it (RAILS_ROOT/lib/some_project/lib/.rb) and their corresponding specs (RAILS_ROOT/spec/some_project/_spec.rb) so that autotest will automatically pick up changes to all of those files and re-run as needed.
How do I get autotest to watch these files in these other directories? I suspect I have to add something to RAILS_ROOT/autotest/discover.rb, but I'm not exactly sure what to do.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这看起来像您想要做的:
http://seandenigris.com/blog/?p=337
This looks like what you want to do:
http://seandenigris.com/blog/?p=337