Test::HTTPTest HTTP interactions | |
Download |
Test::HTTP Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Luke Closs
- Publisher web site:
- http://search.cpan.org/~lukec/Test-Mock-LWP-0.05/lib/Test/Mock/LWP.pm
Test::HTTP Tags
Test::HTTP Description
Test::HTTP is Perl module designed to make it easier to write tests which are mainly about HTTP-level things, such as REST-type services.Each Test::HTTP object can contain state about a current request and its response. This allows convenient shorthands for sending requests, checking status codes, headers, and message bodies.SYNOPSIS use Test::HTTP tests => 9; { my $uri = "$BASE/data/page/Foo_Bar_Baz"; my $type = 'text/x.waki-wiki'; my $test = Test::HTTP->new('HTTP page creation and deletion'); $test->get($uri, {Accept => $type}); $test->status_code_is(404, "Page not yet there."); $test->put($uri, {'Content-type' => $type}, 'xyzzy'); $test->status_code_is(201, "PUT returns 201."); # Created $test->header_is( 'Content-type' => $type, "Content-type matches on PUT."); $test->header_like( Location => qr{^$BASE/data/page/}, "Created page location makes sense."); $test->body_is('xyzzy'); $test->get($uri, {Accept => $type}); $test->status_code_is(200, "Page is now there."); $test->header_is( 'Content-type' => $type, "Content-type matches on GET."); $test->body_is('xyzzy'); $test->delete($uri); $test->status_code_is(204, "DELETE returns 204."); # No content }Product's homepage
Test::HTTP Related Software