X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F04-preconnect.t;h=962b89f2c3dae73fbf9b3cfe5095504798d47d5b;hb=7b3d00f984e43c319a637332579e950376637a3d;hp=7f58d4c88d0de4a426165fde1b984a99ba685d3c;hpb=91adde755e5808a1ec12bcf00e683e3754964cc9;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git diff --git a/t/04-preconnect.t b/t/04-preconnect.t index 7f58d4c..962b89f 100644 --- a/t/04-preconnect.t +++ b/t/04-preconnect.t @@ -10,13 +10,12 @@ use aliased 'DBIx::Class::DeploymentHandler', 'DH'; use File::Path qw(remove_tree mkpath); use Test::More; +use File::Temp 'tempdir'; use Test::Exception; -DBICDHTest::ready; - -my $db = 'dbi:SQLite:db.db'; -my @connection = ($db, '', '', { ignore_version => 1, }, { on_connect_do => sub { die }}); -my $sql_dir = 't/sql'; +my $db = 'dbi:SQLite::memory:'; +my @connection = ($db, '', '', { ignore_version => 1, on_connect_do => sub { die }}); +my $sql_dir = tempdir( CLEANUP => 1 ); VERSION1: { use_ok 'DBICVersion_v1'; @@ -33,8 +32,8 @@ VERSION1: { ok !$s->storage->connected, 'creating handler did not connect'; ok($handler, 'DBIx::Class::DeploymentHandler w/1 instantiates correctly'); - mkpath('t/sql/SQLite/preinstall/1'); - $handler->preinstall({ version => 1, storage_type => 'SQLite' }); + mkpath("$sql_dir/SQLite/initialize/1"); + $handler->initialize({ version => 1, storage_type => 'SQLite' }); ok !$s->storage->connected, 'creating schema did not connect'; } done_testing;