Skip to content

Commit

Permalink
small test improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 18, 2012
1 parent 3b2101d commit da2d732
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions t/mojo/user_agent.t
Expand Up @@ -340,10 +340,11 @@ is_deeply \@kept_alive, [1, 1], 'connections kept alive';

# Premature connection close
my $port = Mojo::IOLoop->generate_port;
my $id
= Mojo::IOLoop->server(
{address => '127.0.0.1', port => $port} => sub { Mojo::IOLoop->remove(pop) }
);
my $id = Mojo::IOLoop->server(
address => '127.0.0.1',
port => $port,
sub { Mojo::IOLoop->remove(pop) }
);
$tx = $ua->get("http://localhost:$port/");
ok !$tx->success, 'not successful';
is $tx->error, 'Premature connection close.', 'right error';

0 comments on commit da2d732

Please sign in to comment.