From: Marcus Ramberg Date: Wed, 8 Mar 2006 18:18:42 +0000 (+0000) Subject: Added tests for has_column_loaded X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4c4ccf291c5ed4c64299da8e03d16ba92f9655d0;p=dbsrgits%2FDBIx-Class-Historic.git Added tests for has_column_loaded --- diff --git a/t/run/01core.tl b/t/run/01core.tl index 34c9b9c..2fd7bef 100644 --- a/t/run/01core.tl +++ b/t/run/01core.tl @@ -1,7 +1,7 @@ sub run_tests { my $schema = shift; -plan tests => 39; +plan tests => 41; my @art = $schema->resultset("Artist")->search({ }, { order_by => 'name DESC'}); @@ -146,6 +146,12 @@ cmp_ok($rel_rs->count, '==', 5, 'Related search ok'); cmp_ok($or_rs->next->cdid, '==', $rel_rs->next->cdid, 'Related object ok'); +my $tag = $schema->resultset('Tag')->search( + [ { 'me.tag' => 'Blue' } ], { cols=>[qw/tagid/] } )->next; + +cmp_ok($tag->has_column_loaded('tagid'), '==', 1, 'Has tagid loaded'); +cmp_ok($tag->has_column_loaded('tag'), '==', 0, 'Has not tag loaded'); + ok($schema->storage(), 'Storage available'); $schema->source("Artist")->{_columns}{'artistid'} = {};