X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fcdbi%2F68-inflate_has_a.t;h=04abccb4cf9adac54359ef5fa3fa8486991debca;hb=67341081b1a57cc8549e51a8fb1b8cd4661543c5;hp=0019e293d049708c5ab7f24246ebd5a086ce7b6d;hpb=50891152d0b24649bfd67bdba97feec86b11c064;p=dbsrgits%2FDBIx-Class.git diff --git a/t/cdbi/68-inflate_has_a.t b/t/cdbi/68-inflate_has_a.t index 0019e29..04abccb 100644 --- a/t/cdbi/68-inflate_has_a.t +++ b/t/cdbi/68-inflate_has_a.t @@ -2,23 +2,14 @@ use strict; use warnings; use Test::More; -BEGIN { - eval "use DBIx::Class::CDBICompat;"; - plan skip_all => "Class::Trigger and DBIx::ContextualFetch required" - if $@; - - eval { require DateTime }; - plan skip_all => "Need DateTime for inflation tests" if $@; +use lib qw(t/cdbi/testlib); +use DBIC::Test::SQLite (); # this will issue the necessary SKIPs on missing reqs - eval { require Clone }; - plan skip_all => "Need Clone for CDBICompat inflation tests" if $@; +BEGIN { + eval { require DateTime; DateTime->VERSION(0.55) } + or plan skip_all => 'DateTime 0.55 required for this test'; } -plan tests => 6; - -use lib qw(t/lib); -use DBICTest; - my $schema = DBICTest->init_schema(); DBICTest::Schema::CD->load_components(qw/CDBICompat::Relationships/); @@ -41,7 +32,7 @@ my $now = DateTime->now; $cd->year( $now ); $cd->update; -($cd) = $schema->resultset("CD")->search( year => $now->year ); +($cd) = $schema->resultset("CD")->search({ year => $now->year }); is( $cd->year->year, $now->year, 'deflate ok' ); # re-test using alternate deflate syntax @@ -62,6 +53,7 @@ $now = DateTime->now; $cd->year( $now ); $cd->update; -($cd) = $schema->resultset("CD")->search( year => $now->year ); +($cd) = $schema->resultset("CD")->search({ year => $now->year }); is( $cd->year->year, $now->year, 'deflate ok' ); +done_testing;