开发者

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

开发者 https://www.devze.com 2023-01-29 04:01 出处:网络
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

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

精彩评论

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