Resolve $rsrc instance duality on metadata traversal
[dbsrgits/DBIx-Class.git] / t / cdbi / 04-lazy.t
index d89d1b4..96d5743 100644 (file)
@@ -1,5 +1,9 @@
+BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
+use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat';
+
 use strict;
 use warnings;
+
 use Test::More;
 use Test::Warn;
 
@@ -7,10 +11,8 @@ use Test::Warn;
 # Test lazy loading
 #----------------------------------------------------------------------
 
-INIT {
-  use lib 't/cdbi/testlib';
-  use Lazy;
-}
+use lib 't/cdbi/testlib';
+use Lazy;
 
 is_deeply [ Lazy->columns('Primary') ],        [qw/this/],      "Pri";
 is_deeply [ sort Lazy->columns('Essential') ], [qw/opop this/], "Essential";
@@ -109,7 +111,7 @@ warning_like {
 
 # Now again for inflated values
 SKIP: {
-    skip "Requires Date::Simple 3.03", 5 unless eval "use Date::Simple 3.03; 1; ";
+    DBIx::Class::Optional::Dependencies->skip_without( 'Date::Simple>=3.03' );
     Lazy->has_a(
         orp     => 'Date::Simple',
         inflate => sub { Date::Simple->new($_[0] . '-01-01') },