X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F749sqlanywhere.t;h=d4067b5bfd7397b11d5d89a81d6c5a2d0c76f504;hb=2c038b0a90ff69084cbdac688105eaa68036d18d;hp=a0e55f9b32783d78a7c6448b7437b19940f6121a;hpb=8273e845426f0187b4ad6c4a1b42286fa09a648f;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/749sqlanywhere.t b/t/749sqlanywhere.t index a0e55f9..d4067b5 100644 --- a/t/749sqlanywhere.t +++ b/t/749sqlanywhere.t @@ -1,12 +1,14 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use Scope::Guard (); use Try::Tiny; use DBIx::Class::Optional::Dependencies (); -use lib qw(t/lib); +use DBIx::Class::_Util 'scope_guard'; + use DBICTest; my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_SQLANYWHERE_${_}" } qw/DSN USER PASS/}; @@ -48,7 +50,7 @@ foreach my $info (@info) { auto_savepoint => 1 }); - my $guard = Scope::Guard->new(\&cleanup); + my $guard = scope_guard { cleanup($schema) }; my $dbh = $schema->storage->dbh; @@ -259,6 +261,7 @@ SQL done_testing; sub cleanup { + my $schema = shift; eval { $schema->storage->dbh->do("DROP TABLE $_") } for qw/artist artist_guid bindtype_test/; }