+use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat';
+
use strict;
use warnings;
+
use Test::More;
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";
# 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') },
# I'm too lazy to set up the proper inflation test.
ok !exists $l->{_column_data}{orp};
}
+
+done_testing;