Skip spurious compiler-related error with old DBD::SQLite and new gcc
[dbsrgits/DBIx-Class.git] / t / cdbi / 04-lazy.t
index 1ca4165..2e37827 100644 (file)
@@ -1,5 +1,8 @@
+use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat';
+
 use strict;
 use warnings;
+
 use Test::More;
 use Test::Warn;
 
@@ -7,18 +10,8 @@ use Test::Warn;
 # Test lazy loading
 #----------------------------------------------------------------------
 
-BEGIN {
-  eval "use DBIx::Class::CDBICompat;";
-  plan $@
-    ? (skip_all => 'Class::Trigger and DBIx::ContextualFetch required')
-    : (tests => 36)
-  ;
-}
-
-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";
@@ -117,7 +110,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') },
@@ -179,3 +172,5 @@ SKIP: {
     # I'm too lazy to set up the proper inflation test.
     ok !exists $l->{_column_data}{orp};
 }
+
+done_testing;