]> iEval git - www-offliberty.git/blobdiff - t/50-network.t
Relax tests
[www-offliberty.git] / t / 50-network.t
index 20b07e63ad55a7541b799bb035273a416efe1428..32574b500e772450b2ed389203e8302a13d30c5d 100644 (file)
@@ -1,20 +1,18 @@
-#!/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 'https://vimeo.com/45196609';
+cmp_ok @results, '>=', 1, 'vimeo';
 
-       my @results;
+@results = off 'https://vimeo.com/45196609', video_file => 1;
+cmp_ok @results, '>=', 1, 'vimeo, 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';
-}
+my $allresults = join ' ', @results;
+like $allresults, qr/\.mp4/, 'some URL contains ".mp4"';
+unlike $allresults, qr/offwarning/, 'no URL contains "offwarning"';
This page took 0.025923 seconds and 4 git commands to generate.