]>
iEval git - webservice-vichan.git/blob - t/WebService-Vichan.t
5 use Test
::RequiresInternet
('a.4cdn.org' => 443, '8ch.net' => 443);
6 use Test
::More tests
=> 17;
8 BEGIN { use_ok
('WebService::Vichan', ':all') };
10 my @URLS = (API_4CHAN
, API_8CHAN
);
13 note
"Now testing $url";
14 my $chan = WebService
::Vichan
->new($url);
16 my @boards = $chan->boards;
17 ok
@boards > 0, 'has boards';
19 my $board = $boards[0];
20 my $boardcode = $board->board;
22 my @threads = $chan->threads($board);
23 my @threads_flat = $chan->threads_flat($board);
24 ok
@threads > 0, "board $boardcode has threads";
27 skip
'race condition', 1 unless $ENV{RELEASE_TESTING
};
28 my $thread3a = $threads[0]->threads->[2];
29 my $thread3b = $threads_flat[2];
30 is
$thread3a->no, $thread3b->no, 'same 3rd thread in threads and threads_flat';
33 my @catalog = $chan->catalog($board);
34 my @catalog_flat = $chan->catalog_flat($board);
35 ok
@catalog > 0, "catalog of board $boardcode is not empty";
38 skip
'race condition', 1 unless $ENV{RELEASE_TESTING
};
39 my $catalog3a = $catalog[0]->threads->[2];
40 my $catalog3b = $catalog_flat[2];
41 is
$catalog3a->no, $catalog3b->no, 'same 3rd thread in catalog and catalog_flat';
44 my $catalog3 = $catalog_flat[2];
45 my $catalog3no = $catalog3->no;
46 ok
defined $catalog3->com, 'catalog entry has content';
48 my @posts = $chan->thread($board, $catalog3);
49 ok
@posts > 0, "thread $catalog3no has posts";
51 is
$catalog3->id, $posts[0]->id, 'catalog entry has same ID as first post';
This page took 0.063334 seconds and 4 git commands to generate.