X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fresultset%2Fplus_select.t;h=db55ac48e3122ab89e93262240b1e1efce61e67d;hb=a6543cfa5769989102af82b5308e23a4ebd3d24d;hp=171779dbdec93230092adcb83f46a3a8fb399a37;hpb=93cee17f8577290c416d9f3d6a82bf2caca090ce;p=dbsrgits%2FDBIx-Class.git diff --git a/t/resultset/plus_select.t b/t/resultset/plus_select.t index 171779d..db55ac4 100644 --- a/t/resultset/plus_select.t +++ b/t/resultset/plus_select.t @@ -2,6 +2,7 @@ use strict; use warnings; use Test::More; +use Math::BigInt; use lib qw(t/lib); use DBICTest; @@ -20,7 +21,7 @@ my %basecols = $cd_rs->first->get_columns; # ramifications of changing this. Thus the value override and the # TODO to go with it. Delete all of this if ever resolved. my %todo_rel_inflation_override = ( artist => $basecols{artist} ); -TODO: { +{ local $TODO = 'Treating relationships as inflatable data is wrong - see comment in ' . __FILE__; ok (! keys %todo_rel_inflation_override); } @@ -42,22 +43,18 @@ is_deeply ( 'extra columns returned by get_inflated_columns without inflatable columns', ); -SKIP: { - eval { require DateTime }; - skip "Need DateTime for +select/get_inflated_columns tests", 1 if $@; - - $schema->class('CD')->inflate_column( 'year', - { inflate => sub { DateTime->new( year => shift ) }, - deflate => sub { shift->year } } - ); +# Test object inflation +$schema->class('CD')->inflate_column( 'year', + { inflate => sub { Math::BigInt->new( shift ) }, + deflate => sub { shift() . '' } } +); - $basecols{year} = DateTime->new ( year => $basecols{year} ); +$basecols{year} = Math::BigInt->new( $basecols{year} ); - is_deeply ( - { $plus_rs->first->get_inflated_columns, %todo_rel_inflation_override }, - { %basecols, tr_cnt => $track_cnt }, - 'extra columns returned by get_inflated_columns', - ); -} +is_deeply ( + { $plus_rs->first->get_inflated_columns, %todo_rel_inflation_override }, + { %basecols, tr_cnt => $track_cnt }, + 'extra columns returned by get_inflated_columns', +); done_testing;