Reorganize CDBICompat tests - centralize prereq checks in one place
[dbsrgits/DBIx-Class.git] / t / cdbi / 22-deflate_order.t
index 1de3f87..a318850 100644 (file)
@@ -3,17 +3,12 @@ use strict;
 
 use Test::More;
 
-eval "use DBIx::Class::CDBICompat; use Time::Piece::MySQL;";
-if ($@) {
-    plan (skip_all => "Time::Piece::MySQL, Class::Trigger and DBIx::ContextualFetch required: $@");
-}
-
-plan skip_all => 'Set $ENV{DBICTEST_MYSQL_DSN}, _USER and _PASS to run this test'
-  unless ($ENV{DBICTEST_MYSQL_DSN} && $ENV{DBICTEST_MYSQL_USER});
+use lib 't/cdbi/testlib';
+use DBIC::Test::SQLite (); # this will issue the necessary SKIPs on missing reqs
 
-plan tests => 3;
+eval { require Time::Piece::MySQL }
+  or plan skip_all => 'Time::Piece::MySQL required for this test';
 
-use lib 't/cdbi/testlib';
 use_ok ('Log');
 
 package main;
@@ -27,3 +22,4 @@ $log->update;
 ok eval { $log->datetime_stamp }, "Have datetime after update";
 diag $@ if $@;
 
+done_testing;