添加自定义目录(源和规范)以在Rails 3项目中进行自动测试 [英] Adding custom directories (source and spec) to autotest in a Rails 3 project

查看:120
本文介绍了添加自定义目录(源和规范)以在Rails 3项目中进行自动测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用RSpec2作为测试框架的Rails 3应用程序,并且能够使用自动测试来监视模型和规范目录中的更改,并在文件更改时重新运行规范套件.

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.

我想添加一个包含一些自定义类的目录(RAILS_ROOT/lib/some_project/lib/ .rb)及其相应的规范(RAILS_ROOT/spec/some_project/ _spec.rb ),以便自动测试将自动提取对所有这些文件的更改并根据需要重新运行.

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.

如何进行自动测试以查看其他目录中的这些文件?我怀疑我必须在RAILS_ROOT/autotest/discover.rb中添加一些内容,但是我不确定该怎么做.

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.

推荐答案

这看起来像您想要执行的操作: http://seandenigris.com/blog/?p=337

This looks like what you want to do: http://seandenigris.com/blog/?p=337

这篇关于添加自定义目录(源和规范)以在Rails 3项目中进行自动测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆