🕷 zenspider.com

by ryan davis

Looking for the Ruby Quickref?

autotest freaking out? Try -v and nuke the extras

Published 2007-06-11 @ 21:39

Tagged zentest, rails, ruby, minitest

I just had a bug on autotest get diagnosed by the filer:

“The root cause is that I have “require ‘turn’” in my project (which provides prettier Test::Unit output) but Autotest::handle_results isn’t designed to parse turn’s output.”

This was an advanced issue caused by turn (I do hope he files a bug against turn), and solved simply by removing it.

I’ve seen much simpler issues that can be nearly as confusing. For example, several projects I’ve worked on that generated thumbnails or index files in RAILS_ROOT, triggering autotest to rerun. This can be confusing, but there is an easy way to figure this stuff out. Run autotest -v and it’ll tell you what file changes it detected before rerunning… Then it is a matter of changing your code or adding a .autotest like so:

  Autotest.add_hook :run do  |at|
    at.exceptions = /^(?:\.\/)?(?:db|doc|log|public|script|tmp|filestore|vendor\/r

Ugly… I know. I’ll come up with a more flexible means of adding a single exclusion.