X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=t%2F50-network.t;h=c67d2d33d1434896790b334516aafd8a5f112d19;hb=8e74b4c85ca723cf8c47c7a6eff3f155dc53aed5;hp=20b07e63ad55a7541b799bb035273a416efe1428;hpb=000e34969f016810f1455865a926ad62d8f810c2;p=www-offliberty.git diff --git a/t/50-network.t b/t/50-network.t index 20b07e6..c67d2d3 100644 --- a/t/50-network.t +++ b/t/50-network.t @@ -1,20 +1,17 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl use strict; use warnings; -use Test::More; +use Test::RequiresInternet 'offliberty.com' => 80; +use Test::More tests => 4; use WWW::Offliberty qw/off/; -if ($ENV{NETWORK_TEST}) { - plan tests => 2; +my @results; +@results = off "http://youtube.com/watch?v=Tj75Arhq5ho"; +cmp_ok @results, '>=', 1, 'youtube'; - my @results; +@results = off "http://youtube.com/watch?v=Tj75Arhq5ho", video_file => 1; +is @results, 2, 'youtube, video_file => 1'; - @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'; -} +like $results[1], qr/\.mp4/, 'video URL contains ".mp4"'; +unlike $results[0], qr/offwarning/, 'audio URL doesn\'t contain "offwarning"';