Remove all uses of Scope::Guard from the tests, use our own version
[dbsrgits/DBIx-Class.git] / t / 749sqlanywhere.t
index 0b66bb5..a52b5bd 100644 (file)
@@ -3,9 +3,9 @@ use warnings;
 
 use Test::More;
 use Test::Exception;
-use Scope::Guard ();
 use Try::Tiny;
 use DBIx::Class::Optional::Dependencies ();
+use DBIx::Class::_Util 'scope_guard';
 use lib qw(t/lib);
 use DBICTest;
 
@@ -23,6 +23,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 +32,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 +48,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;