]> Dogcows Code - chaz/p5-HTTP-AnyUA/blob - t/50-future-subclass.t
add Dockerfile for testing
[chaz/p5-HTTP-AnyUA] / t / 50-future-subclass.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 tests => 2;
10 use Util qw(test_user_agent);
11
12 HTTP::AnyUA->register_backend(Mock => '+MockBackend');
13
14 subtest 'test Future::Mojo as a Future response' => sub {
15 test_user_agent 'Mojo::UserAgent' => sub {
16 plan tests => 1;
17
18 my $ua = shift;
19 my $any_ua = HTTP::AnyUA->new($ua, response_is_future => 1);
20
21 my $url = 'http://acme.tld/';
22
23 my $future = $any_ua->get($url);
24 isa_ok($future, 'Future::Mojo');
25
26 return $future;
27 };
28 };
29
30 subtest 'test AnyEvent::Future as a Future response' => sub {
31 test_user_agent 'AnyEvent::HTTP' => sub {
32 plan tests => 1;
33
34 my $ua = shift;
35 my $any_ua = HTTP::AnyUA->new($ua, response_is_future => 1);
36
37 my $url = 'http://acme.tld/';
38
39 my $future = $any_ua->get($url);
40 isa_ok($future, 'AnyEvent::Future');
41
42 return $future;
43 };
44 };
45
This page took 0.031058 seconds and 4 git commands to generate.