Ash Berlin > Net-HTTP-Spore > Net::HTTP::Spore::Middleware::Mock

Download:
Net-HTTP-Spore-0.06.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.06   Source  

NAME ^

Net::HTTP::Spore::Middleware::Mock - Simple Mocker for Spore middlewares

VERSION ^

version 0.06

SYNOPSIS ^

    my $mock_server = {
        '/path/i/want/to/match' => sub {
            my $req = shift;
            ...
            $req->new_response(200, ['Content-Type' => 'text/plain'], 'ok');
        }
    };

    my $client = Net::HTTP::Spore->new_from_spec('spec.json');
    $client->enable('Mock', tests => $mock_server);
    my $res = $client->my_rest_method();
    is $res->status, 200;
    is $res->body, 'ok';

DESCRIPTION ^

AUTHORS ^

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2012 by linkfluence.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: