If you have a Rails application that doesn't make use of a database, it doesn't make sense to have supply a database.yml file, much less to supply valid connection information. But if you delete database.yml or leave the database.yml file with the default values, when you run your tests they error out because a connection with the database couldn't be established. Removing ActiveRecord from config.frameworks in the Rails::Initializer.run block in environment.rb changes the error a bit, but there's still an error.
It seems to be very difficult to get Rails not to load the ActiveRecord files at all, so rather than working out how to optionally disable all of the requires where code assumes that you will always use ActiveRecord, I changed the three places that actually directly try to use the connection object despite ActiveRecord not actually being used.
In my particular case, I'm writing an app that primarily uses the file system as a data store.
Long-term, I don't think Rails should assume that ActiveRecord will always be used in an app, but in the meantime, this patch should allow ActiveRecord to be ignored if necessary. If the problem is fixed eventually, this patch should continue to function correctly.