In a project we needed to write different parsers for different services. Rather than putting all those parsers in app/models or in lib we created a new directory. We put all the parsers in app/parsers .
We put all the tests for these parsers in test/parsers directory.
We can run tests parsers individually by executing rake test test/parsers/email_parser_test.rb. However when we run rake then tests in test/parsers are not picked up.
We added following code to Rakefile to make rake pickup tests in test/parsers.
Now when we run rake or rake test then tests under test/parsers are also picked up.
Above code adds a rake task rake test:parsers which would run all tests under test/parsers directory.
We can see this task by execute rake -T test.