Autotest mapping for Rails test conventions
A while ago I posted a configuration for getting autotest to work with
Test::Unit outside of Rails. Ryan Davis, author of autotest, commented on that post saying that it should “Just Work™” without any custom configuration. I was perplexed because I’ve never been able to get it to work on my gems and Rails plugins.
I finally took time to look into the issue, and realized it’s because I always use the Rails naming conventions for my test files. I name them
foo_test.rb, instead of
test_foo.rb, which is what Autotest looks for.
That’s easily solvable. Here’s an Autotest configuration, tested with ZenTest 3.10.0, that should make it work for either naming convention. You can throw this in your
~/.autotest file, or in a
.autotest file inside your project.