Force DataMapper to disconnect from postgresql

I have a test that creates and destroys several databases in postgresql. To be able to delete the database, I need to inform DataMapper about the disconnect. I can't seem to find documentation on how to do this.

There is a close_connection method in DataMapper :: Adapters :: PostgresAdapter, but it is protected and requires a connection object that I cannot get.

Is it possible?

+2
source share
1 answer

DataObjects::Pooling.pools.each {|pool| pool.dispose}seems to work as long as you only have one connection open.

+3
source

All Articles