开发者

How do I tell autotest to run my tests instead of my specs?

I have a rails 3 project with both specs and tests. If I fire up autotest it runs my specs. How can I make it r开发者_C百科un my tests instead? autotest -h is no help here.


Try this on the command line:

RSPEC=false autotest

I know that setting the RSPEC environment variable to "true" works when autotest doesn't know it's supposed to run them, so the reverse might be true as well. I think recent versions assume that when they see specs, you're not using Test::Unit anymore, so hopefully they've kept this override.


Do you have the file "autotest/discovery.rb" under the app root? If you have, comment all the code, if not, create the dir and an empty file with the name.

Then add the following code to the file:

Autotest.add_hook :initialize do |at|
  at.add_mapping(%r%^test/(functional|integration|performance|unit)/.*rb$%) do |filename, _|
    filename
  end
end

Now you can run with your tests instead of specs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜