Skip to content

Commit

Permalink
expect failure
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 23, 2017
1 parent 55ab414 commit a48d0e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/Mojo/UserAgent.pm
Expand Up @@ -307,8 +307,8 @@ sub _start {
my $max = $self->max_response_size;
$tx->res->max_message_size($max) if defined $max;

# Connect and add request timeout if necessary
my $id = $self->emit(start => $tx)->_connection($loop, $tx, $cb);
$self->emit(start => $tx);
return undef unless my $id = $self->_connection($loop, $tx, $cb);
if (my $timeout = $self->request_timeout) {
weaken $self;
$self->{connections}{$id}{timeout}
Expand Down
2 changes: 1 addition & 1 deletion t/mojo/user_agent.t
Expand Up @@ -176,7 +176,7 @@ is $tx->res->max_message_size, 0, 'right value';
is $tx->res->body, 'works!', 'right content';

# Unsupported protocol
$tx = $ua->get('htttp://example.com');
$tx = $ua->request_timeout(3600)->get('htttp://example.com');
ok !$tx->success, 'not successful';
is $tx->error->{message}, 'Unsupported protocol: htttp', 'right error';
eval { $tx->result };
Expand Down

0 comments on commit a48d0e6

Please sign in to comment.