/XML-OverHTTP/t/21_page.t

http://xml-treepp.googlecode.com/ · Raku · 31 lines · 24 code · 3 blank · 4 comment · 2 complexity · 1289f71ba954d71263f73f3a1344b4f9 MD5 · raw file

  1. # ----------------------------------------------------------------
  2. use strict;
  3. use Test::More;
  4. require 't/MyAPI_env.pm.testing';
  5. # ----------------------------------------------------------------
  6. SKIP: {
  7. local $@;
  8. eval { require Data::Page; } unless defined $Data::Page::VERSION;
  9. if ( ! defined $Data::Page::VERSION ) {
  10. plan skip_all => 'Data::Page is not loaded.';
  11. }
  12. plan tests => 10;
  13. use_ok('XML::OverHTTP');
  14. my $api = MyAPI_env->new();
  15. ok( ref $api, 'api' );
  16. my $pager = $api->page;
  17. ok( ref $pager, 'page' );
  18. is( $pager->first_page, 1, 'first_page' );
  19. is( $pager->last_page, 1, 'last_page' );
  20. is( $pager->first, 1, 'first' );
  21. is( $pager->last, 1, 'last' );
  22. ok( ! $pager->previous_page, 'previous_page' );
  23. ok( ! $pager->next_page, 'next_page' );
  24. is( $pager->skipped, 0, 'skipped' );
  25. }
  26. # ----------------------------------------------------------------
  27. ;1;
  28. # ----------------------------------------------------------------