X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fcdbi%2F04-lazy.t;h=d89d1b49d76d8a5706ee4093bfed5ca323608945;hb=26aea721d0dd94fe9920efa3c01f081642399c28;hp=60a6d3e02e309245f920f4ec15d07dc26b32f110;hpb=6a3bf2519832866d037740c5fb22341dad6f8bb3;p=dbsrgits%2FDBIx-Class.git diff --git a/t/cdbi/04-lazy.t b/t/cdbi/04-lazy.t index 60a6d3e..d89d1b4 100644 --- a/t/cdbi/04-lazy.t +++ b/t/cdbi/04-lazy.t @@ -1,6 +1,5 @@ -#!/usr/bin/perl -w - use strict; +use warnings; use Test::More; use Test::Warn; @@ -8,14 +7,6 @@ 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; @@ -111,7 +102,7 @@ warning_like { }, undef, 23, $l->this); is $l->oop, 23; - + $l->delete; } @@ -124,7 +115,7 @@ SKIP: { inflate => sub { Date::Simple->new($_[0] . '-01-01') }, deflate => 'format' ); - + my $l = Lazy->create({ this => 89, that => 2, @@ -136,13 +127,13 @@ SKIP: { SET orp = ? WHERE this = ? }, undef, 1987, $l->this); - + is $l->orp, '1987-01-01'; $l->orp(2007); is $l->orp, '2007-01-01'; # make sure it's inflated $l->update; - + ok $l->db_Main->do(qq{ UPDATE @{[ $l->table ]} SET orp = ? @@ -150,7 +141,7 @@ SKIP: { }, undef, 1942, $l->this); is $l->orp, '1942-01-01'; - + $l->delete; } @@ -164,19 +155,21 @@ SKIP: { oop => 3, opop => 4, }); - + # Delete the object without it knowing. Lazy->db_Main->do(qq[ DELETE FROM @{[ Lazy->table ]} WHERE this = 99 ]); - + $l->eep; - + # The problem was when an object had an inflated object # loaded. _flesh() would set _column_data to undef and # get_column() would think nothing was there. # I'm too lazy to set up the proper inflation test. ok !exists $l->{_column_data}{orp}; } + +done_testing;