autotest 4.4.6、zentest 4.4.1 不适用于控制器文件的 Rails 应用程序(但适用于规范文件)
我知道已经有一些关于自动测试和 zentest 的问题,但我的问题似乎有点不同。就我而言,如果我运行时
autotest
除了显示“正在等待...”的状态消息之外没有任何反应,并且没有运行任何测试。如果我运行它
autotest -s rspec2
那么我所有的测试都会运行。如果我更改 spec 文件,自动测试就会知道并重新运行我的测试。但是,如果我更改控制器文件,那么我只会更新“等待...”消息,但不会运行任何测试。
有什么想法吗?或者有人可以指出我可以进一步研究这个问题的地方吗?
.autotest(我实际上不知道#是否是如何注释掉一个部分!)
require 'autotest/fsevent'
#require 'autotest/restart'
require 'autotest/growl'
require 'autotest/timestamp'
我从不使用“sudo gem install”,因为我使用的是rvm。所以只有“gem install X”
I know there are a few questions already regarding autotest and zentest but my problem seems a little different. In my case, if I run with
autotest
nothing happens other than a status message saying "Waiting since..." with no tests being run. If I run it with
autotest -s rspec2
Then all my tests run. If I change a spec file autotest knows and re-runs my tests. But if I change a controller file then I just get my "Waiting since..." message updated but no tests are run.
Any ideas what's going on? Or can someone please point me where I can look into this further?
.autotest (i actually don't know if # is how to comment out a section!)
require 'autotest/fsevent'
#require 'autotest/restart'
require 'autotest/growl'
require 'autotest/timestamp'
I never use "sudo gem install" because I am using rvm. So only "gem install X"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的问题看起来与此非常相似autotest on ubuntu不执行任何操作
Your problem looks very much similar to this autotest on ubuntu does nothing
您唯一需要的 gem 是
autotest
,因此请卸载其余的。或者,您可以在 Mac 上使用autotest-fsevent
和autotest-growl
。确保有一个包含以下内容的
autotest/discover.rb
:它应该由
railsgenerate rspec:install
生成如果您的应用程序目录中有其他目录,您可以通过创建一个
.autotest
文件将它们添加到自动测试中,其中包含以下内容:(基于 Rails3 和 RSpec2 的答案)
The only gem you need is
autotest
, so deinstall the rest. Optionally, you can useautotest-fsevent
andautotest-growl
on a mac.Make sure there is an
autotest/discover.rb
with the following contents:It should've been generated by
rails generate rspec:install
If you have additional directories in your app directory, you add them to autotest by making a
.autotest
file, containing something like:(Answer based on Rails3 and RSpec2)