I've added a few modules and dropped them in my /lib directory and I think the lib directory is loaded magically by Rails (unless I loaded the lib directory somewhere early in my project and forgot about it). However, when I run unit tests that require my additional modules, they are not loaded.
Should the lib directory be loaded automatically when running tests, or is there an elegant way to do so for testing? I had hoped that the rake scripts + Test::Unit would've loaded up my Rails environment exactly, but this doesn't seem to be the case. I'm left with doing adding something like this to test_helper.rb:
require File.expand_path(File.dirname(__FILE__) + "/../lib/foo")
I'm running my tests with the standard rake scripts like:
rake test
rake test:units
rake test:functionals