Add use_moo option
[dbsrgits/DBIx-Class-Schema-Loader.git] / t / 10_04db2_common.t
index e0804b8..0533dc0 100644 (file)
@@ -1,3 +1,6 @@
+use DBIx::Class::Schema::Loader::Optional::Dependencies
+    -skip_all_without => 'test_rdbms_db2';
+
 use strict;
 use warnings;
 use Test::More;
@@ -17,9 +20,6 @@ my $dsn      = $ENV{DBICTEST_DB2_DSN} || '';
 my $user     = $ENV{DBICTEST_DB2_USER} || '';
 my $password = $ENV{DBICTEST_DB2_PASS} || '';
 
-plan skip_all => 'You need to set the DBICTEST_DB2_DSN, _USER, and _PASS environment variables'
-    unless ($dsn && $user);
-
 my ($schema, $schemas_created); # for cleanup in END for extra tests
 
 my $srv_ver = do {
@@ -37,7 +37,7 @@ my $extra_graphics_data_types = {
     'dbclob'           => { data_type => 'dbclob' },
 };
 
-my $tester = dbixcsl_common_tests->new(
+dbixcsl_common_tests->new(
     vendor         => 'DB2',
     auto_inc_pk    => 'INTEGER GENERATED BY DEFAULT AS IDENTITY NOT NULL PRIMARY KEY',
     dsn            => $dsn,
@@ -148,7 +148,7 @@ my $tester = dbixcsl_common_tests->new(
                 }
                 catch {
                     $schemas_created = 0;
-                    skip "no CREATE SCHEMA privileges", 28 * 2;
+                    skip "no CREATE SCHEMA privileges", 30 * 2;
                 };
 
                 $dbh->do(<<"EOF");
@@ -352,9 +352,7 @@ EOF
 
         },
     },
-);
-
-$tester->run_tests();
+)->run_tests();
 
 END {
     if (not $ENV{SCHEMA_LOADER_TESTS_NOCLEANUP}) {