Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
not all tests require the singleton
  • Loading branch information
kraih committed Dec 14, 2015
1 parent 8ea4321 commit 1151591
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions t/mojo/user_agent.t
Expand Up @@ -131,14 +131,14 @@ is $code, 200, 'right status';
is $body, 'works!', 'right content';

# SOCKS proxy request without SOCKS support
$ua = Mojo::UserAgent->new(ioloop => Mojo::IOLoop->singleton);
$ua = Mojo::UserAgent->new;
my $tx = $ua->build_tx(GET => '/');
$tx->req->proxy($ua->server->url->scheme('socks'));
$tx = $ua->start($tx);
like $tx->error->{message}, qr/IO::Socket::Socks/, 'right error';

# HTTPS request without TLS support
$ua = Mojo::UserAgent->new(ioloop => Mojo::IOLoop->singleton);
$ua = Mojo::UserAgent->new;
$tx = $ua->get($ua->server->url->scheme('https'));
like $tx->error->{message}, qr/IO::Socket::SSL/, 'right error';

Expand Down Expand Up @@ -308,6 +308,7 @@ is $code, 200, 'right status';
is $body, '{"hello":"world"}', 'right content';

# Built-in web server times out
$ua = Mojo::UserAgent->new(ioloop => Mojo::IOLoop->singleton);
my $log = '';
my $msg = app->log->on(message => sub { $log .= pop });
$tx = $ua->get('/timeout?timeout=0.25');
Expand Down

0 comments on commit 1151591

Please sign in to comment.