Lee ♫ Goddard > Test-WWW-Mechanize-JSON-0.2 > Test::WWW::Mechanize::JSON

Download:
Test-WWW-Mechanize-JSON-0.2.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View Bugs
Report a bug
Module Version: 0.2   Source  

NAME ^

Test::WWW::Mechanize::JSON - add a JSON method to the super-class

SYNOPSIS ^

        use Test::More 'no_plan';
        use_ok("Test::WWW::Mechanize::JSON") or BAIL_OUT;
        my $MECH = Test::WWW::Mechanize::JSON->new(
                noproxy => 1,
                etc     => 'other-params-for-Test::WWW::Mechanize',
        );
        $MECH->get('http://example.com/json');
        my $json_as_perl = $MECH->json_ok or BAIL_OUT Dumper $MECH->response;
        $MECH->diag_json;

DESCRIPTION ^

Extends Test::WWW::Mechanize to test the JSON script and JSON output.

METHODS: HTTP VERBS

$mech->json_ok($desc)

Tests that the last received resopnse is valid JSON.

A default description of "Got JSON from $url" or "Not JSON from $url" is used if none if provided.

Returns the JSON object, that you may perform further tests upon it.

$mech->diag_json

Like diag, but renders the JSON of the last request with indentation.

AUTHOR AND COPYRIGHT ^

Copyright (C) Lee Goddard, 2009.

Available under the same terms as Perl itself.