Skip to content

Commit

Permalink
no more leaks in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 15, 2015
1 parent a326162 commit fa66e86
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions t/mojo/websocket.t
Expand Up @@ -140,7 +140,7 @@ $ua->websocket(
'/' => sub {
my ($ua, $tx) = @_;
$tx->on(finish => sub { Mojo::IOLoop->stop });
$tx->on(message => sub { $result = pop; $tx->finish });
$tx->on(message => sub { shift->finish; $result = shift });
$tx->send('test1');
}
);
Expand Down Expand Up @@ -341,7 +341,7 @@ $ua->websocket(
'/squish' => sub {
my ($ua, $tx) = @_;
$tx->on(finish => sub { Mojo::IOLoop->stop });
$tx->on(message => sub { $result = pop; $tx->finish });
$tx->on(message => sub { shift->finish; $result = shift });
$tx->send(b(' foo bar '));
}
);
Expand Down Expand Up @@ -400,7 +400,7 @@ $ua->websocket(
'/echo' => sub {
my ($ua, $tx) = @_;
$tx->on(finish => sub { Mojo::IOLoop->stop });
$tx->on(message => sub { $result = pop; $tx->finish });
$tx->on(message => sub { shift->finish; $result = shift });
$tx->send('hi!' x 100);
}
);
Expand Down
6 changes: 3 additions & 3 deletions t/mojo/websocket_proxy.t
Expand Up @@ -130,7 +130,7 @@ $ua->websocket(
"ws://127.0.0.1:$port/test" => sub {
my ($ua, $tx) = @_;
$tx->on(finish => sub { Mojo::IOLoop->stop });
$tx->on(message => sub { $result = pop; $tx->finish });
$tx->on(message => sub { shift->finish; $result = shift });
$tx->send('test1');
}
);
Expand Down Expand Up @@ -160,7 +160,7 @@ $ua->websocket(
my ($ua, $tx) = @_;
$kept_alive = $tx->kept_alive;
$tx->on(finish => sub { Mojo::IOLoop->stop });
$tx->on(message => sub { $result = pop; $tx->finish });
$tx->on(message => sub { shift->finish; $result = shift });
$tx->send('test1');
}
);
Expand All @@ -181,7 +181,7 @@ $ua->websocket(
"ws://127.0.0.1:$port/test" => sub {
my ($ua, $tx) = @_;
$tx->on(finish => sub { Mojo::IOLoop->stop });
$tx->on(message => sub { $result = pop; $tx->finish });
$tx->on(message => sub { shift->finish; $result = shift });
$tx->send('test1');
}
);
Expand Down
4 changes: 2 additions & 2 deletions t/mojo/websocket_proxy_tls.t
Expand Up @@ -190,7 +190,7 @@ $ua->websocket(
"wss://127.0.0.1:$port/test" => sub {
my ($ua, $tx) = @_;
$tx->on(finish => sub { Mojo::IOLoop->stop });
$tx->on(message => sub { $result = pop; $tx->finish });
$tx->on(message => sub { shift->finish; $result = shift });
$tx->send('test1');
}
);
Expand Down Expand Up @@ -237,7 +237,7 @@ $ua->websocket(
my ($ua, $tx) = @_;
$kept_alive = $tx->kept_alive;
$tx->on(finish => sub { Mojo::IOLoop->stop });
$tx->on(message => sub { $result = pop; $tx->finish });
$tx->on(message => sub { shift->finish; $result = shift });
$tx->send('test1');
}
);
Expand Down

0 comments on commit fa66e86

Please sign in to comment.