# Directory structure for additional tests

**URL:** <https://www.ruby-forum.com/t/directory-structure-for-additional-tests/116266>\
**Category:** Rails\
**Created:** [October 3, 2007, 11:42pm UTC](https://www.ruby-forum.com/t/directory-structure-for-additional-tests/116266 "2007-10-03T23:42:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rykkers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e5b9ba/32.png) [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Post date:** [October 3, 2007, 11:42pm UTC](https://www.ruby-forum.com/t/directory-structure-for-additional-tests/116266/1 "2007-10-03T23:42:25Z")

</div>

I like to test things besides models, views and controllers.

For example, I’ve got a current project with a significant chunk of  
code in the lib directory. Right now I’ve got a test case for it in  
the test/integration directory since it feels to me like an  
integration test.

I’m curious how others handle this. Do you make a parallel test  
directory for lib code? Or fit it into the directories that are  
there. If you add directories then do you write additional Rake  
tasks?

The reason I’m asking is that I just submitted a patch to autotest  
because although it would re-execute my testcase on the lib code if I  
modified the testcase, changing the code under test wouldn’t trigger  
autotest to test it.

My patch looks for a testcase matching the code file in lib with \_test  
added in any of test/unit test/functional and test/integration and I  
was wondering if this was the right approach in general.
