X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F68inflate.t;h=3aa428da29af504734601187461fd4859eb21bf5;hb=db326a590fb76893c9e57dea0fca59be67ba25de;hp=2e7c374ca27a9e8d11d0598b3a07c5543129f1da;hpb=d5d833d959dea814d49ea3d15010cb42ab6ee310;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/68inflate.t b/t/68inflate.t index 2e7c374..3aa428d 100644 --- a/t/68inflate.t +++ b/t/68inflate.t @@ -5,15 +5,16 @@ use Test::More; use lib qw(t/lib); use DBICTest; -DBICTest::Schema::CD->add_column('year'); my $schema = DBICTest->init_schema(); eval { require DateTime }; plan skip_all => "Need DateTime for inflation tests" if $@; -plan tests => 20; +plan tests => 21; -DBICTest::Schema::CD->inflate_column( 'year', +$schema->class('CD') +#DBICTest::Schema::CD +->inflate_column( 'year', { inflate => sub { DateTime->new( year => shift ) }, deflate => sub { shift->year } } ); @@ -98,6 +99,10 @@ $cd->update({ year => \'year + 1'}); $cd->discard_changes; is($cd->year->year, $before_year + 1, 'discard_changes clears the inflated value'); + +my $copy = $cd->copy({ year => $now, title => "zemoose" }); + +isnt( $copy->year->year, $before_year, "copy" ); # eval { $cd->store_inflated_column('year', \'year + 1') }; # print STDERR "ERROR: $@" if($@);