diff --git a/.travis.yml b/.travis.yml index 328672d..4e07bc2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ language: perl perl: - - "5.12" - - "5.14" - - "5.16" - - "5.18" - - "5.20" + - "5.22" + - "5.24" + - "5.26" + - "5.28" + - "5.30" before_install: cpanm -n Devel::Cover::Report::Coveralls XML::OPML::SimpleGen diff --git a/t/07_page.t b/t/07_page.t new file mode 100644 index 0000000..7f56dc1 --- /dev/null +++ b/t/07_page.t @@ -0,0 +1,13 @@ +use strict; +use warnings; +use Test::More; +use_ok('Perlanet'); + +# Test fetching a page without the cache trait. +ok(my $p = Perlanet->new(), 'Object created'); +isa_ok($p, 'Perlanet'); +ok(my $page = $p->fetch_page('http://blogs.dave.org.uk/rss.xml'), + 'Page fetched'); +isa_ok($page, 'URI::Fetch::Response'); + +done_testing(); diff --git a/t/08_opml.t b/t/08_opml.t new file mode 100644 index 0000000..e6a4f45 --- /dev/null +++ b/t/08_opml.t @@ -0,0 +1,35 @@ +use strict; +use warnings; +use Test::More; +use FindBin qw($Bin); +use File::Temp qw(tempfile); +use_ok('Perlanet::Simple'); + +chdir $Bin; +ok(my $p = Perlanet::Simple->new_with_config(configfile => 'testrc'), + 'Object created'); +isa_ok($p,'Perlanet'); + +SKIP: { + skip 'XML::OPML::SimpleGen not installed', 1 unless $p->has_opml; + + my (undef, $opml_file) = tempfile(OPEN => 0); + $p->opml($opml_file); + $p->run(); + $p->save_opml(); + ok(-e $opml_file, 'OPML file created'); + + if (-e $p->opml) { + unlink $p->opml; + } + + if (-e $p->feed->{file}) { + unlink $p->feed->{file}; + } + + if (-e $p->page->{file}) { + unlink $p->page->{file}; + } +} + +done_testing();