diff options
author | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2014-12-12 12:22:58 +0000 |
---|---|---|
committer | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2014-12-12 12:22:58 +0000 |
commit | 3503e8484ba6399e51aec16d01278970f6a0ebe5 (patch) | |
tree | 58455d3c794b2fe689b99743f490474ab360b7c3 /cpan/HTTP-Tiny | |
parent | d8fed09de8351f26e4a38b4b3018846227c7cc00 (diff) | |
download | perl-3503e8484ba6399e51aec16d01278970f6a0ebe5.tar.gz |
Update HTTP-Tiny to CPAN version 0.053
[DELTA]
0.053 2014-12-11 23:42:17-05:00 America/New_York
[FIXED]
- Defended tests against HTTP_PROXY set in the environment
Diffstat (limited to 'cpan/HTTP-Tiny')
-rw-r--r-- | cpan/HTTP-Tiny/lib/HTTP/Tiny.pm | 4 | ||||
-rw-r--r-- | cpan/HTTP-Tiny/t/140_proxy.t | 22 | ||||
-rw-r--r-- | cpan/HTTP-Tiny/t/Util.pm | 3 |
3 files changed, 16 insertions, 13 deletions
diff --git a/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm b/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm index 1a1e0920a7..1276acc033 100644 --- a/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm +++ b/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm @@ -4,7 +4,7 @@ use strict; use warnings; # ABSTRACT: A small, simple, correct HTTP/1.1 client -our $VERSION = '0.052'; +our $VERSION = '0.053'; use Carp (); @@ -1458,7 +1458,7 @@ HTTP::Tiny - A small, simple, correct HTTP/1.1 client =head1 VERSION -version 0.052 +version 0.053 =head1 SYNOPSIS diff --git a/cpan/HTTP-Tiny/t/140_proxy.t b/cpan/HTTP-Tiny/t/140_proxy.t index 2432fed2fb..eda3d6f33a 100644 --- a/cpan/HTTP-Tiny/t/140_proxy.t +++ b/cpan/HTTP-Tiny/t/140_proxy.t @@ -6,13 +6,18 @@ use warnings; use File::Basename; use Test::More 0.88; +use t::Util qw[ monkey_patch ]; use HTTP::Tiny; +BEGIN { + monkey_patch(); +} + + # Require a true value for my $proxy (undef, "", 0){ local $ENV{all_proxy} = undef; local $ENV{ALL_PROXY} = undef; - local $ENV{HTTP_PROXY} = $proxy; local $ENV{http_proxy} = $proxy; my $c = HTTP::Tiny->new(); ok(!defined $c->http_proxy); @@ -50,19 +55,18 @@ for my $proxy ("http://localhost:8080/", "http://localhost:8080"){ } # case variations -my @vars = map +(uc, lc), qw/http_proxy https_proxy all_proxy/; -for my $var ( @vars ) { +for my $var ( qw/http_proxy https_proxy all_proxy/ ) { my $proxy = "http://localhost:8080"; - local @ENV{@vars}; - local $ENV{$var} = $proxy; - my $c = HTTP::Tiny->new(); - my $m = ($var =~ /all/i) ? 'proxy' : lc($var); - is( $c->$m, $proxy, "set $m from $var" ); + for my $s ( uc($var), lc($var) ) { + local $ENV{$s} = $proxy; + my $c = HTTP::Tiny->new(); + my $m = ($s =~ /all/i) ? 'proxy' : lc($s); + is( $c->$m, $proxy, "set $m from $s" ); + } } # ignore HTTP_PROXY with REQUEST_METHOD { - local $ENV{http_proxy}; local $ENV{HTTP_PROXY} = "http://localhost:8080"; local $ENV{REQUEST_METHOD} = 'GET'; my $c = HTTP::Tiny->new(); diff --git a/cpan/HTTP-Tiny/t/Util.pm b/cpan/HTTP-Tiny/t/Util.pm index 717eaa765a..448c0312b2 100644 --- a/cpan/HTTP-Tiny/t/Util.pm +++ b/cpan/HTTP-Tiny/t/Util.pm @@ -169,8 +169,7 @@ sub sort_headers { *HTTP::Tiny::Handle::close = sub { 1 }; # don't close our temps # don't try to proxy in mock-mode - delete $ENV{$_} - for map { $_, uc($_) } qw/http_proxy https_proxy all_proxy/; + delete $ENV{$_} for map { $_, uc($_) } qw/http_proxy https_proxy all_proxy/; } } |