PageRenderTime 27ms CodeModel.GetById 15ms app.highlight 9ms RepoModel.GetById 2ms app.codeStats 0ms

/XML-OverHTTP/t/21_page.t

http://xml-treepp.googlecode.com/
Unknown | 31 lines | 28 code | 3 blank | 0 comment | 0 complexity | 1289f71ba954d71263f73f3a1344b4f9 MD5 | raw file
 1# ----------------------------------------------------------------
 2    use strict;
 3    use Test::More;
 4    require 't/MyAPI_env.pm.testing';
 5# ----------------------------------------------------------------
 6SKIP: {
 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
15    my $api = MyAPI_env->new();
16    ok( ref $api, 'api' );
17
18    my $pager = $api->page;
19    ok( ref $pager, 'page' );
20
21    is( $pager->first_page,  1,  'first_page' );
22    is( $pager->last_page,   1,  'last_page' );
23    is( $pager->first,       1,  'first' );
24    is( $pager->last,        1,  'last' );
25    ok( ! $pager->previous_page, 'previous_page' );
26    ok( ! $pager->next_page,     'next_page' );
27    is( $pager->skipped,     0,  'skipped' );
28}
29# ----------------------------------------------------------------
30;1;
31# ----------------------------------------------------------------