Skip to content

Commit

Permalink
fixed timeout test
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 25, 2012
1 parent c737802 commit 153f79b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/Mojo/UserAgent.pm
Expand Up @@ -15,7 +15,7 @@ use constant DEBUG => $ENV{MOJO_USERAGENT_DEBUG} || 0;
# "You can't let a single bad experience scare you away from drugs."
has ca => sub { $ENV{MOJO_CA_FILE} };
has cert => sub { $ENV{MOJO_CERT_FILE} };
has connect_timeout => sub { $ENV{MOJO_CONNECT_TIMEOUT} // 10 };
has connect_timeout => sub { $ENV{MOJO_CONNECT_TIMEOUT} || 10 };
has cookie_jar => sub { Mojo::CookieJar->new };
has [qw/http_proxy https_proxy local_address no_proxy/];
has inactivity_timeout => sub { $ENV{MOJO_INACTIVITY_TIMEOUT} // 20 };
Expand Down
6 changes: 2 additions & 4 deletions t/mojo/user_agent.t
Expand Up @@ -6,7 +6,7 @@ BEGIN {
$ENV{MOJO_IOWATCHER} = 'Mojo::IOWatcher';
}

use Test::More tests => 86;
use Test::More tests => 85;

# "The strong must protect the sweet."
use Mojo::IOLoop;
Expand Down Expand Up @@ -88,9 +88,7 @@ get '/echo' => sub {
{
is(Mojo::UserAgent->new->connect_timeout, 10, 'right value');
local $ENV{MOJO_CONNECT_TIMEOUT} = 25;
is(Mojo::UserAgent->new->connect_timeout, 25, 'right value');
$ENV{MOJO_CONNECT_TIMEOUT} = 0;
is(Mojo::UserAgent->new->connect_timeout, 0, 'right value');
is(Mojo::UserAgent->new->connect_timeout, 25, 'right value');
is(Mojo::UserAgent->new->inactivity_timeout, 20, 'right value');
local $ENV{MOJO_INACTIVITY_TIMEOUT} = 25;
is(Mojo::UserAgent->new->inactivity_timeout, 25, 'right value');
Expand Down

0 comments on commit 153f79b

Please sign in to comment.