Skip to content

Commit

Permalink
removed a few too dangerous tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Oct 2, 2011
1 parent 8cd642e commit a48a110
Showing 1 changed file with 1 addition and 30 deletions.
31 changes: 1 addition & 30 deletions t/mojo/user_agent.t
Expand Up @@ -7,7 +7,7 @@ BEGIN {
$ENV{MOJO_IOWATCHER} = 'Mojo::IOWatcher';
}

use Test::More tests => 76;
use Test::More tests => 64;

use_ok 'Mojo::UserAgent';

Expand Down Expand Up @@ -224,35 +224,6 @@ is $tx->kept_alive, 1, 'kept connection alive';
is $tx->res->code, 200, 'right status';
is $tx->res->body, 'works!', 'right content';

# Taint connection
Mojo::IOLoop->singleton->write($last => 'broken!');
sleep 1;

# GET / (mock server tainted connection)
$tx = $ua->get("http://localhost:$port/mock");
ok $tx->success, 'successful';
is $tx->kept_alive, undef, 'kept connection not alive';
is $tx->res->code, 200, 'right status';
is $tx->res->body, 'works!', 'right content';

# GET / (mock server again)
$tx = $ua->get("http://localhost:$port/mock");
ok $tx->success, 'successful';
is $tx->kept_alive, 1, 'kept connection alive';
is $tx->res->code, 200, 'right status';
is $tx->res->body, 'works!', 'right content';

# Taint connection
Mojo::IOLoop->singleton->write($last => 'broken!');
sleep 1;

# GET / (mock server tainted connection)
$tx = $ua->get("http://localhost:$port/mock");
ok $tx->success, 'successful';
is $tx->kept_alive, undef, 'kept connection not alive';
is $tx->res->code, 200, 'right status';
is $tx->res->body, 'works!', 'right content';

# GET / (built-in server)
$tx = $ua->get('/');
ok $tx->success, 'successful';
Expand Down

0 comments on commit a48a110

Please sign in to comment.