Skip to content

Commit

Permalink
a few more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 15, 2017
1 parent fdc582e commit e9a7c14
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion t/mojo/user_agent.t
@@ -1,7 +1,7 @@
use Mojo::Base -strict;

BEGIN {
$ENV{MOJO_NO_SOCKS} = $ENV{MOJO_NO_TLS} = 1;
$ENV{MOJO_NO_NNR} = $ENV{MOJO_NO_SOCKS} = $ENV{MOJO_NO_TLS} = 1;
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll';
}

Expand Down Expand Up @@ -138,11 +138,16 @@ 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';
ok !Mojo::IOLoop::Client->can_socks, 'no SOCKS5 support';

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

# No non-blocking name resolution
ok !Mojo::IOLoop::Client->can_nnr, 'no non-blocking name resolution support';

# Blocking
$tx = $ua->get('/');
Expand Down

0 comments on commit e9a7c14

Please sign in to comment.