X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FDBICTest.pm;h=a2eef1bd3ae7e65c109651f160ccddd886e05f6d;hb=1c339d715e7bf746c8aec49981060f25a6649370;hp=09a05b63d5872cdfeeaa3b6cba771b89ef31f36d;hpb=ccae0573e39c15a598d9640aaf8e6d31fcadc01e;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/lib/DBICTest.pm b/t/lib/DBICTest.pm index 09a05b6..a2eef1b 100755 --- a/t/lib/DBICTest.pm +++ b/t/lib/DBICTest.pm @@ -1,118 +1,20 @@ +package DBICTest; + use strict; use warnings; use DBICTest::Schema; -my $db_file = "t/var/DBIxClass.db"; - -unlink($db_file) if -e $db_file; -unlink($db_file . "-journal") if -e $db_file . "-journal"; -mkdir("t/var") unless -d "t/var"; - -DBICTest::Schema->compose_connection('DBICTest' => "dbi:SQLite:${db_file}"); - -my $dbh = DBICTest::_db->storage->dbh; - -my $sql = <do($_) for split(/\n\n/, $sql); - +sub initialise { + + my $db_file = "t/var/DBIxClass.db"; + + unlink($db_file) if -e $db_file; + unlink($db_file . "-journal") if -e $db_file . "-journal"; + mkdir("t/var") unless -d "t/var"; + + my $dsn = "dbi:SQLite:${db_file}"; + + return DBICTest::Schema->compose_connection('DBICTest' => $dsn); +} + 1;