updated on Thu Jan 26 00:18:00 UTC 2012
[aur-mirror.git] / perl-html-wikiconverter / no-useragent-tests.patch
blob23b7b336b9756e3a55d9ac369711019f8768a3ed
1 --- HTML-WikiConverter-0.68/t/01-wikiconverter.t 2009-03-08 03:24:42.000000000 +0100
2 +++ HTML-WikiConverter-0.68-new/t/01-wikiconverter.t 2011-12-11 14:41:32.779254868 +0100
3 @@ -71,10 +71,9 @@
5 package main;
7 -use Test::More tests => 53;
8 +use Test::More tests => 49;
9 use HTML::WikiConverter;
11 -my $have_lwp = eval "use LWP::UserAgent; 1";
12 my $have_query_param = eval "use URI::QueryParam; 1";
14 my $wc = new HTML::WikiConverter(
15 @@ -155,21 +154,6 @@
16 is( $wc4->html2wiki( html => '<', escape_entities => 1 ), '<', "escape entities" );
17 is( $wc4->html2wiki( html => '<' ), '<', "escape_entities is enabled by default" );
19 -SKIP: {
20 - skip "LWP::UserAgent required for testing how content is fetched from URIs" => 4 unless $have_lwp;
21 - skip "Couldn't fetch test website http://www.perl.org. Perhaps you don't have internet access?" => 4 unless LWP::UserAgent->new->get('http://www.perl.org')->is_success;
23 - is( $wc4->html2wiki( uri => 'http://diberri.dyndns.org/wikipedia/html2wiki-old/test.html', strip_tags => ['head'] ), '**test**', 'fetch uri, no ua' );
24 - is( $wc4->user_agent->agent, $wc4->__default_ua_string, 'using default ua' );
26 - my $ua_agent = 'html2wiki-test/0.5x';
27 - my $ua = new LWP::UserAgent( agent => $ua_agent );
28 - $wc4->user_agent($ua);
30 - is( $wc4->html2wiki( uri => 'http://diberri.dyndns.org/wikipedia/html2wiki-old/test.html', strip_tags => ['head'] ), '**test**', 'fetch uri w/ ua' );
31 - is( $wc4->user_agent->agent, $ua_agent, 'using user-specified ua' );
32 -};
34 eval { $wc4->html2wiki( url => '...' ) };
35 ok( $@ =~ /not a valid argument/, 'url not a valid argument to html2wiki()' );