From: Marius Gavrilescu Date: Sun, 4 May 2014 06:08:57 +0000 (+0300) Subject: Use LWP::Online in network test X-Git-Tag: 0.002~3 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=045faed66663b14c8bc70e70c2653c8558af2766;p=www-offliberty.git Use LWP::Online in network test --- diff --git a/Makefile.PL b/Makefile.PL index 7f39996..36089b8 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -9,6 +9,9 @@ WriteMakefile( EXE_FILES => ['off'], MIN_PERL_VERSION => '5.14.0', LICENSE => 'perl', + BUILD_REQUIRES => { + qw/LWP::Online 0/, + }, SIGN => 1, PREREQ_PM => { qw/Getopt::Long 0 diff --git a/t/50-network.t b/t/50-network.t index 20b07e6..ef9b682 100644 --- a/t/50-network.t +++ b/t/50-network.t @@ -2,19 +2,13 @@ use strict; use warnings; -use Test::More; +use LWP::Online ':skip_all'; +use Test::More tests => 2; use WWW::Offliberty qw/off/; -if ($ENV{NETWORK_TEST}) { - plan tests => 2; +my @results; +@results = off "http://youtube.com/watch?v=Tj75Arhq5ho"; +is @results, 1, 'youtube'; - my @results; - - @results = off "http://youtube.com/watch?v=Tj75Arhq5ho"; - is @results, 1, 'youtube'; - - @results = off "http://youtube.com/watch?v=Tj75Arhq5ho", video_file => 1; - is @results, 2, 'youtube, video_file => 1'; -} else { - plan skip_all => '$ENV{NETWORK_TEST} not true'; -} +@results = off "http://youtube.com/watch?v=Tj75Arhq5ho", video_file => 1; +is @results, 2, 'youtube, video_file => 1';