X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Frun%2F08inflate.tl;h=e21a6c6faf961a97e4d72558190bb918adbbca74;hb=b3caf56c71e1bab50211ac1c6606bc1c59f6072b;hp=97d07780bc02f8da826b910691192059a4e26e6a;hpb=9fcda149ae69bff53f58a198d4b922e64e6b5c83;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/run/08inflate.tl b/t/run/08inflate.tl index 97d0778..e21a6c6 100644 --- a/t/run/08inflate.tl +++ b/t/run/08inflate.tl @@ -4,7 +4,7 @@ my $schema = shift; eval { require DateTime }; plan skip_all => "Need DateTime for inflation tests" if $@; -plan tests => 5; +plan tests => 3; DBICTest::Schema::CD->inflate_column( 'year', { inflate => sub { DateTime->new( year => shift ) }, @@ -27,34 +27,6 @@ $cd->update; ($cd) = $schema->resultset("CD")->search( year => $now->year ); is( $cd->year->year, $now->year, 'deflate ok' ); -use YAML; -DBICTest::Schema::Serialized->inflate_column( 'serialized', - { inflate => sub { Load (shift) }, - deflate => sub { die "Expecting a reference" unless (ref $_[0]); Dump (shift) } } -); -Class::C3->reinitialize; - -my $complex1 = { - id => 1, - serialized => { - a => 1, - b => 2, - }, -}; - -my $complex2 = { - id => 1, - serialized => [qw/a b 1 2/], -}; - -my $rs = $schema->resultset('Serialized'); - -my $entry = $rs->create($complex2); - -ok($entry->update ($complex1), "update with hashref deflating ok"); - -ok($entry->update ($complex2), "update with arrayref deflating ok"); - } 1;