diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-03-15 18:47:53 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-03-15 18:47:53 +0000 |
commit | a4eda25bf0f72d757244b128657832bc4da28375 (patch) | |
tree | 5a4bda4947a8d19e1f07c2385db1aff2c18ba0d2 /dev-perl/Feed-Find/files | |
parent | 6e8d3793323b8f24be801a4aaf31cdd31a8483e9 (diff) |
gentoo auto-resync : 15:03:2024 - 18:47:52
Diffstat (limited to 'dev-perl/Feed-Find/files')
-rw-r--r-- | dev-perl/Feed-Find/files/Feed-Find-0.07-local-network.patch | 109 |
1 files changed, 0 insertions, 109 deletions
diff --git a/dev-perl/Feed-Find/files/Feed-Find-0.07-local-network.patch b/dev-perl/Feed-Find/files/Feed-Find-0.07-local-network.patch deleted file mode 100644 index 4cf8f567547a..000000000000 --- a/dev-perl/Feed-Find/files/Feed-Find-0.07-local-network.patch +++ /dev/null @@ -1,109 +0,0 @@ -From bea092aae37300053b971a12b6e37b6104df41f9 Mon Sep 17 00:00:00 2001 -From: Nikolay Mishin <mi@ya.ru> -Date: Thu, 22 Oct 2015 02:59:04 +0400 -Subject: Rework 01-find.t - -Rework test to not rely on external web resources by mocking the setup -with a HTTP::Server::Simple derived webserver - -Bug: https://github.com/btrott/Feed-Find/pull/2 -Signed-off-by: Gary Greene <greeneg@tolharadys.net> -Signed-off-by: Kent Fredric <kentnl@gentoo.org> ---- - t/01-find.t | 57 ++++++++++++++++++++++++++++++++------ - t/htdocs/anchors-only.html | 9 ++++++ - 2 files changed, 58 insertions(+), 8 deletions(-) - create mode 100644 t/htdocs/anchors-only.html - -diff --git a/t/01-find.t b/t/01-find.t -index 58549b5..22d0048 100644 ---- a/t/01-find.t -+++ b/t/01-find.t -@@ -1,20 +1,61 @@ -+use CGI::Application::Server; -+use Test::HTTP::Server::Simple; -+ -+package My::WebServer { -+ use base qw/Test::HTTP::Server::Simple CGI::Application::Server/; -+} -+ -+package main; -+ - use strict; --use Test::More tests => 4; -+use Test::More tests => 5; - use Feed::Find; - use LWP::UserAgent; - --use constant BASE => 'http://stupidfool.org/perl/feeds/'; -+my $port = $ENV{CGI_APP_SERVER_TEST_PORT} || 40000 + int(rand(10000)); -+ -+my $s = My::WebServer->new($port); -+$s->document_root('./t/htdocs'); -+ -+my $url_root = $s->started_ok("start up my web server"); -+ -+# generate our anchors-only.html file to get the URL correct in the links -+my $anchor_html = <<"END"; -+<html> -+ <head> -+ <link rel="alternate" title="my feed" -+ href="$url_root/ok.xml" type="application/xml" /> -+ <head> -+ <body> -+ <a href="$url_root/ok.xml" type="application/xml">my feed</a> -+ </body> -+</html> -+END - --my(@feeds); -+open(my $fh, ">./t/htdocs/anchors-only.html") or -+ die "Cannot open file\n"; -+print $fh <<"END"; -+<html> -+ <head> -+ <link rel="alternate" title="my feed" -+ href="$url_root/ok.xml" type="application/xml" /> -+ <head> -+ <body> -+ <a href="$url_root/ok.xml" type="application/xml">my feed</a> -+ </body> -+</html> -+END -+close $fh; - --@feeds = Feed::Find->find(BASE . 'anchors-only.html'); -+my @feeds = (); -+@feeds = Feed::Find->find("$url_root/anchors-only.html"); - is(scalar @feeds, 1); --is($feeds[0], BASE . 'ok.xml'); -+is($feeds[0], "$url_root/ok.xml"); - - my $ua = LWP::UserAgent->new; - $ua->env_proxy; --my $req = HTTP::Request->new(GET => BASE . 'anchors-only.html'); -+my $req = HTTP::Request->new(GET => "$url_root/anchors-only.html"); - my $res = $ua->request($req); --@feeds = Feed::Find->find_in_html(\$res->content, BASE . 'anchors-only.html'); -+@feeds = Feed::Find->find_in_html(\$res->content, "$url_root/anchors-only.html"); - is(scalar @feeds, 1); --is($feeds[0], BASE . 'ok.xml'); -+is($feeds[0], "$url_root/ok.xml"); -diff --git a/t/htdocs/anchors-only.html b/t/htdocs/anchors-only.html -new file mode 100644 -index 0000000..79f1df8 ---- /dev/null -+++ b/t/htdocs/anchors-only.html -@@ -0,0 +1,9 @@ -+<html> -+ <head> -+ <link rel="alternate" title="my feed" -+ href="http://localhost:45578/ok.xml" type="application/xml" /> -+ <head> -+ <body> -+ <a href="http://localhost:45578/ok.xml" type="application/xml">my feed</a> -+ </body> -+</html> --- -2.28.0 - |