Add strict/warnings test, adjust all offenders (wow, that was a lot)
[dbsrgits/DBIx-Class.git] / t / cdbi / 24-meta_info.t
index ba72f17..f2fc57f 100644 (file)
@@ -1,22 +1,20 @@
 use strict;
+use warnings;
 use Test::More;
+use Test::Warn;
 
-BEGIN {
-  eval "use DBIx::Class::CDBICompat;use Time::Piece;";
-  plan skip_all => "Time::Piece, Class::Trigger and DBIx::ContextualFetch required: $@"
-    if $@;
+use lib 't/cdbi/testlib';
+use DBIC::Test::SQLite (); # this will issue the necessary SKIPs on missing reqs
 
-  plan tests => 12;
-}
-
-use Test::Warn;
+eval { require Time::Piece }
+  or plan skip_all => 'Time::Piece required for this test';
 
 package Temp::DBI;
 use base qw(DBIx::Class::CDBICompat);
 Temp::DBI->columns(All => qw(id date));
 
-my $strptime_inflate = sub { 
-    Time::Piece->strptime(shift, "%Y-%m-%d") 
+my $strptime_inflate = sub {
+    Time::Piece->strptime(shift, "%Y-%m-%d")
 };
 Temp::DBI->has_a(
     date => 'Time::Piece',
@@ -73,3 +71,5 @@ package main;
     is $date->accessor,         'date';
     is $date->args->{inflate},  $strptime_inflate;
 }
+
+done_testing;