kazuho/p5-test-mysqld — pull request #6 by jjn1056 (2012-02-28 14:46:20+00:00)
Title: Move the "Already Running" error inside the auto_start block

This is a tiny patch that moves the "Already Running" error a few lines down so that we only issue it IF we are asked to start a database. That way one can use Test::mysqld to use a database that is already running and created by a previous call to Test::mysqld.

This lets you set auto_start to 0 and skip trying to start the database, without hitting that error message. My use case for this is in DBIx::Class::Migration when a user is using the test database for running upgrades and downgrades but does not want to stop the database first. I also think this change would give you a bit of added flexibility when desiring to run tests against a running database.

Thanks! I've been making great use of your module for Test::DBIx::Class and now DBIx::Class::Migration and ti has really helped me.