X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=t%2FWebService-TDWTF.t;h=17b8a117ab7b6611194bfa62774fb6861047d722;hb=47cb627d192b8c39f5be90cf874adec6bd9d2247;hp=2c2d53ea00d224b8a1369f50b3c8257ab9fe7613;hpb=54c23de0aec8b304483d67092053f47cdc1cb1ae;p=webservice-tdwtf.git diff --git a/t/WebService-TDWTF.t b/t/WebService-TDWTF.t index 2c2d53e..17b8a11 100644 --- a/t/WebService-TDWTF.t +++ b/t/WebService-TDWTF.t @@ -3,7 +3,7 @@ use strict; use warnings; use Test::RequiresInternet ('thedailywtf.com' => 80); -use Test::More tests => 14; +use Test::More tests => 15; BEGIN { use_ok('WebService::TDWTF') }; my $art = tdwtf_article; @@ -20,7 +20,7 @@ is @recent, 2, 'tdwtf_list_recent 2'; my @dec15 = tdwtf_list_recent 2015, 12; is $dec15[0]->Title, 'Best of 2015: The A(nti)-Team', 'tdwtf_list_recent 2015, 12'; -is $dec15[0]->BodyHtml, '', '->BodyHtml'; +#is $dec15[0]->BodyHtml, '', '->BodyHtml'; isnt $dec15[0]->Body, '', '->Body'; isnt $dec15[0]->Body, '', '->Body (cached)'; @@ -30,6 +30,11 @@ is @erik, 8, 'tdwtf_list_author \'erik-gern\''; my @sod = tdwtf_list_series 'code-sod', 5; is @sod, 5, 'tdwtf_list_series \'code-sod\', 5'; +my @series = tdwtf_series; +note 'Found ' . @series . ' series'; +cmp_ok @series, '==', scalar tdwtf_series, 'tdwtf_series scalar context'; +my ($codesod) = grep { $_->{Title} =~ /codesod/i } @series; +is $codesod->{Slug}, 'code-sod', 'tdwtf_series finds CodeSOD'; my ($last) = tdwtf_list_recent 1; ok !defined $last->NextArticle, 'last article has no next article';