initial commit
[chaz/p5-HTTP-AnyUA] / t / 02-shortcuts.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 => 10;
10
11 HTTP::AnyUA->register_backend(Mock => '+MockBackend');
12
13 my $any_ua = HTTP::AnyUA->new(ua => 'Mock');
14 my $backend = $any_ua->backend;
15
16 my $url = 'http://acme.tld/';
17
18 for my $shortcut (qw{get head put post delete}) {
19 my $resp = $any_ua->$shortcut($url);
20 my $request = ($backend->requests)[-1];
21 is $request->[0], uc($shortcut), "$shortcut shortcut makes a request with the correct method";
22 is $request->[1], $url, "$shortcut shortcut makes a request with the correct URL";
23 }
24
This page took 0.033393 seconds and 4 git commands to generate.