X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fcdbi%2Fsweet%2F08pager.t;h=7f94e51b25c583a80bccf45910e57dccd00aeeb3;hb=ee5733658f9bca488689f85a61c9cd7092138f85;hp=015ea983e567ea2fe0efdacbb90e65c6ea5005ed;hpb=68de943862f06cabd397d2e74d12cd9cdc999779;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/cdbi/sweet/08pager.t b/t/cdbi/sweet/08pager.t index 015ea98..7f94e51 100644 --- a/t/cdbi/sweet/08pager.t +++ b/t/cdbi/sweet/08pager.t @@ -1,20 +1,12 @@ +use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; + use strict; use warnings; use Test::More; -BEGIN { - eval "use DBIx::Class::CDBICompat;"; - if ($@) { - plan (skip_all => 'Class::Trigger and DBIx::ContextualFetch required'); - next; - } - plan tests => 10; -} - use lib 't/lib'; - -use_ok('DBICTest'); +use DBICTest; DBICTest::Schema::CD->load_components(qw/CDBICompat CDBICompat::Pager/); @@ -27,7 +19,7 @@ my ( $pager, $it ) = DBICTest::CD->page( { order_by => 'title', rows => 3, page => 1 } ); - + cmp_ok( $pager->entries_on_this_page, '==', 3, "entries_on_this_page ok" ); cmp_ok( $pager->next_page, '==', 2, "next_page ok" ); @@ -58,7 +50,7 @@ is( $it->next, undef, "disable_sql_paging next past end of page ok" ); # based on a failing criteria submitted by waswas ( $pager, $it ) = DBICTest::CD->page( { title => [ - -and => + -and => { -like => '%bees' }, @@ -70,3 +62,5 @@ is( $it->next, undef, "disable_sql_paging next past end of page ok" ); { rows => 5 } ); is( $it->count, 1, "complex abstract count ok" ); + +done_testing;