I'm trying to build a ruby gem that uses active_record to connect to a database. How can I configure a separate test and regular database (like rails) so that the test database is used while running tests and the regular database is used otherwise?
Assuming you are using PostgreSQL, you would set it in your
test: adapter: postgresql encoding: unicode database: app_test pool: 5 username: username password:
You haven't explained what you mean by "regular database", but it could be
Then you have a second entry in the
database.yml file for it.