Sporadic NonInferrableControllerError on nested controller tests with Rails 2.1

Hey folks. I’ve been getting this aggravating error sporadically on
some of my nested controller tests since upgrading to Rails 2.1. The
last bout seems to be here to stay and it’s driving me mad.

I have the following in my controllers dir (names changed for
simplicity):

tools_controller.rb
tools folder
tools/screwdriers_controller.rb
tools/wrenches_controller.rb
tools/hammers_controller.rb

When I run rake, I am getting NonInferrableControllerError errors on
two out of the three nested controllers and for the life of me, I have
no idea why. If I run the test files individually, I get no errors.

Insight appreciated.

Here’s the trace I get from rake.

ActionController::NonInferrableControllerError: Unable to determine the controller to test from WrenchesControllerTest. You'll need to specify it using 'tests YourController' in your test case definition. This could mean that WrenchesControllerTest does not exist or it contains syntax errors /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/test_case.rb:64:in `determine_default_controller_class' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/test_case.rb:57:in `controller_class' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/test_case.rb:73:in `setup_controller_request_and_response' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/ active_support/callbacks.rb:173:in `send' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/ active_support/callbacks.rb:173:in `evaluate_method' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/ active_support/callbacks.rb:161:in `call' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/ active_support/callbacks.rb:90:in `run' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/ active_support/callbacks.rb:90:in `each' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/ active_support/callbacks.rb:90:in `send' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/ active_support/callbacks.rb:90:in `run' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/ active_support/callbacks.rb:272:in `run_callbacks' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/ active_support/testing/setup_and_teardown.rb:31:in `run'
Again, if I run the rb file on its own via ruby/test/functional/
whateer_test.rb it runs just fine. The namespacing is correct, yes.

One of the files that’s failing has a full suite of tests, while the
other file is still in the default state with only a test_truth test.
The third file that’s not failing is also in a default state.

Anyone?

Resolved. It was an SVN/TextMate issue with residual test files
sticking around and conflicting namespaces.