X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Finflate%2Fdatetime_msaccess.t;h=f01219987aee14898faf5b576483fffef71fa2cf;hb=1eb87dd767c4bdb815085acb2a8e63e12b32f990;hp=00450cd4e85c8745c7619b562607200e76a63f0c;hpb=a0034ff6946ef2782a34d5c1f333eb448833e46f;p=dbsrgits%2FDBIx-Class.git diff --git a/t/inflate/datetime_msaccess.t b/t/inflate/datetime_msaccess.t index 00450cd..f012199 100644 --- a/t/inflate/datetime_msaccess.t +++ b/t/inflate/datetime_msaccess.t @@ -34,19 +34,17 @@ my @connect_info = ( [ $dsn2, $user2 || '', $pass2 || '' ], ); -my $schema; - for my $connect_info (@connect_info) { my ($dsn, $user, $pass) = @$connect_info; next unless $dsn; - $schema = DBICTest::Schema->connect($dsn, $user, $pass, { + my $schema = DBICTest::Schema->connect($dsn, $user, $pass, { on_connect_call => 'datetime_setup', quote_names => 1, }); - my $guard = Scope::Guard->new(\&cleanup); + my $guard = Scope::Guard->new(sub { cleanup($schema) }); try { local $^W = 0; $schema->storage->dbh->do('DROP TABLE track') }; $schema->storage->dbh->do(<<"SQL"); @@ -82,6 +80,7 @@ done_testing; # clean up our mess sub cleanup { + my $schema = shift; # have to reconnect to drop a table that's in use if (my $storage = eval { $schema->storage }) { local $^W = 0;