Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

replace LWP::Simple with LWP::UserAgent

LWP::Simple inherits proxy settings from the environment, which can lead
to irritating test failures.
  • Loading branch information...
commit 96ef403733153e0ad8e11a8b771119062bdcd027 1 parent 51f7494
Danijel Tasov authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 t/00base.t
7 t/00base.t
View
@@ -3,7 +3,7 @@ use warnings;
use File::Basename ();
use List::Util qw(first);
-use LWP::Simple ();
+use LWP::UserAgent ();
use Test::TCP ();
use Test::More;
@@ -44,7 +44,10 @@ sub doit {
}
sleep 1;
- is(LWP::Simple::get("http://127.0.0.1:$port/"), 'hello');
+ my $ua = LWP::UserAgent->new;
+ my $response = $ua->get("http://127.0.0.1:$port/");
+ ok($response->is_success, "request successfull");
+ is($response->content, 'hello', 'content is hello');
kill 'TERM', $server_pid;
while (wait == -1) {}
Please sign in to comment.
Something went wrong with that request. Please try again.