X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F749sqlanywhere.t;h=d4067b5bfd7397b11d5d89a81d6c5a2d0c76f504;hb=07a243ad8f4273317a028eb7a55a8682a713eba3;hp=0b66bb5d07b6137bbbd704286d2c81187db9b5ee;hpb=2c2bc4e58c2146670960fc1a0a2ae802cb650506;p=dbsrgits%2FDBIx-Class.git diff --git a/t/749sqlanywhere.t b/t/749sqlanywhere.t index 0b66bb5..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/}; @@ -23,6 +25,8 @@ plan skip_all => 'Test needs ' . or (not $dsn || $dsn2); +DBICTest::Schema->load_classes('ArtistGUID'); + # tests stolen from 748informix.t plan skip_all => <<'EOF' unless $dsn || $dsn2; @@ -30,9 +34,6 @@ Set $ENV{DBICTEST_SQLANYWHERE_DSN} and/or $ENV{DBICTEST_SQLANYWHERE_ODBC_DSN}, _USER and _PASS to run these tests EOF -require DBICTest::Schema; -DBICTest::Schema->load_classes('ArtistGUID'); - my @info = ( [ $dsn, $user, $pass ], [ $dsn2, $user2, $pass2 ], @@ -49,7 +50,7 @@ foreach my $info (@info) { auto_savepoint => 1 }); - my $guard = Scope::Guard->new(sub{ cleanup($schema) }); + my $guard = scope_guard { cleanup($schema) }; my $dbh = $schema->storage->dbh;