From 045faed66663b14c8bc70e70c2653c8558af2766 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sun, 4 May 2014 09:08:57 +0300 Subject: [PATCH] Use LWP::Online in network test --- Makefile.PL | 3 +++ t/50-network.t | 20 +++++++------------- 2 files changed, 10 insertions(+), 13 deletions(-) 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'; -- 2.39.2