Switch from Test::Exception to Test::Fatal
[dbsrgits/DBIx-Class-DeploymentHandler.git] / t / 04-preconnect.t
index 4e3a77b..860b394 100644 (file)
@@ -10,13 +10,11 @@ use aliased 'DBIx::Class::DeploymentHandler', 'DH';
 
 use File::Path qw(remove_tree mkpath);
 use Test::More;
-use Test::Exception;
+use File::Temp 'tempdir';
 
-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,7 +31,7 @@ VERSION1: {
   ok !$s->storage->connected, 'creating handler did not connect';
   ok($handler, 'DBIx::Class::DeploymentHandler w/1 instantiates correctly');
 
-  mkpath('t/sql/SQLite/initialize/1');
+  mkpath("$sql_dir/SQLite/initialize/1");
   $handler->initialize({ version => 1, storage_type => 'SQLite' });
   ok !$s->storage->connected, 'creating schema did not connect';
 }