In the initialize.rb file framework_paths does not exclude dirs for frameworks that are not used. This patch uses the default_frameworks to include the framework dirs. It appeared that railties, actionpack and activesupport were not optional frameworks so they are included by default. This code also assumes that the framework will use a lib directory (activerecord/lib).
I have modified the ConfigurationMock for the test. Under the mocks directory in the test (/trunk/railties/test/mocks) 4 folders have to be created actionmailer,activerecord,activeresource and railites. Each of those 4 folders need to have another folder inside them called lib.