From: Peter Rabbitson Date: Sat, 19 Dec 2009 11:51:21 +0000 (+0000) Subject: Failing test X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b4b946f81f3a0dc4e70e2290e540f7a15f2a88c9;p=dbsrgits%2FDBIx-Class-Historic.git Failing test --- diff --git a/t/resultset/nulls_only.t b/t/resultset/nulls_only.t new file mode 100644 index 0000000..facf299 --- /dev/null +++ b/t/resultset/nulls_only.t @@ -0,0 +1,29 @@ +use strict; +use warnings; + +use lib qw(t/lib); +use Test::More; +use Test::Exception; +use DBICTest; + +my $schema = DBICTest->init_schema(); + + +my $cd_rs = $schema->resultset('CD')->search ({ genreid => undef }, { columns => [ 'genreid' ]} ); +my $count = $cd_rs->count; +cmp_ok ( $count, '>', 1, 'several CDs with no genre'); + +my @objects = $cd_rs->all; +is (scalar @objects, $count, 'Correct amount of objects without limit'); +isa_ok ($_, 'DBICTest::CD') for @objects; + +is_deeply ( + [ map { values %{{$_->get_columns}} } (@objects) ], + [ (undef) x $count ], + 'All values are indeed undef' +); + + +isa_ok ($cd_rs->search ({}, { rows => 1 })->single, 'DBICTest::CD'); + +done_testing;