Institute a central "load this first in testing" package
[dbsrgits/DBIx-Class.git] / t / cdbi / 68-inflate_has_a.t
index 04abccb..6398494 100644 (file)
@@ -1,14 +1,12 @@
+BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
+use DBIx::Class::Optional::Dependencies -skip_all_without => qw( ic_dt cdbicompat );
+
 use strict;
 use warnings;
-use Test::More;
 
-use lib qw(t/cdbi/testlib);
-use DBIC::Test::SQLite (); # this will issue the necessary SKIPs on missing reqs
+use Test::More;
 
-BEGIN {
-  eval { require DateTime; DateTime->VERSION(0.55) }
-    or plan skip_all => 'DateTime 0.55 required for this test';
-}
+use DBICTest;
 
 my $schema = DBICTest->init_schema();
 
@@ -18,7 +16,7 @@ DBICTest::Schema::CD->has_a( 'year', 'DateTime',
       inflate => sub { DateTime->new( year => shift ) },
       deflate => sub { shift->year }
 );
-Class::C3->reinitialize;
+Class::C3->reinitialize if DBIx::Class::_ENV_::OLD_MRO;
 
 # inflation test
 my $cd = $schema->resultset("CD")->find(3);