Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
simplify proxy test
  • Loading branch information
kraih committed Aug 9, 2014
1 parent 206061b commit baa6828
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions t/mojo/websocket_proxy_tls.t
Expand Up @@ -276,18 +276,18 @@ is $tx->res->body, "https://localhost:$port/proxy", 'right content';
# Proxy WebSocket with bad target
$ua->proxy->https("http://localhost:$proxy");
my $port2 = $port + 1;
$result = undef;
my ($success, $err);
$ua->websocket(
"wss://localhost:$port2/test" => sub {
my ($ua, $tx) = @_;
$result = $tx;
$success = $tx->success;
$err = $tx->res->error;
Mojo::IOLoop->stop;
}
);
Mojo::IOLoop->start;
ok !$result->success, 'no success';
is $result->res->error->{message}, 'Proxy connection failed', 'right error';
is $result->error->{message}, 'Proxy connection failed', 'right error';
ok !$success, 'no success';
is $err->{message}, 'Proxy connection failed', 'right error';

# Failed TLS handshake through proxy
$tx = $ua->get("https://localhost:$fake");
Expand Down

0 comments on commit baa6828

Please sign in to comment.