Add tdwtf_series function for new API call
[webservice-tdwtf.git] / t / WebService-TDWTF.t
index 2c2d53ea00d224b8a1369f50b3c8257ab9fe7613..74c95753aac4a9a0b1e8ec3dfba5738e8096e4d8 100644 (file)
@@ -3,7 +3,7 @@ use strict;
 use warnings;
 
 use Test::RequiresInternet ('thedailywtf.com' => 80);
-use Test::More tests => 14;
+use Test::More tests => 16;
 BEGIN { use_ok('WebService::TDWTF') };
 
 my $art = tdwtf_article;
@@ -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';
This page took 0.009827 seconds and 4 git commands to generate.