initial commit
[chaz/p5-HTTP-AnyUA] / t / 04-internal-exception.t
1 #!perl
2
3 use warnings;
4 use strict;
5
6 use lib 't/lib';
7
8 use HTTP::AnyUA;
9 use Test::More;
10 use Util qw(:test :ua);
11
12 plan tests => scalar user_agents;
13
14 test_all_user_agents {
15 plan tests => 3;
16
17 my $ua = shift;
18 my $any_ua = HTTP::AnyUA->new($ua, response_is_future => 1);
19
20 my $url = 'invalidscheme://acme.tld/hello';
21 my $future = $any_ua->get($url);
22
23 $future->on_ready(sub {
24 my $self = shift;
25 my $resp = $self->is_done ? $self->get : $self->failure;
26
27 note explain 'RESPONSE: ', $resp;
28
29 is_response_reason($resp, 'Internal Exception');
30 is_response_status($resp, 599);
31 is_response_success($resp, 0);
32 });
33
34 return $future;
35 };
36
This page took 0.034042 seconds and 4 git commands to generate.