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',
is $date->accessor, 'date';
is $date->args->{inflate}, $strptime_inflate;
}
+
+done_testing;