Web::MREST::Test - Test helper functions
This module provides helper code for unit tests.
Perform the boilerplate tasks that have to be done at the beginning of every unit. Takes a PARAMHASH with two optional parameters:
'class' => class into which Web::Machine object is to be blessed 'sitedir' => sitedir parameter to be passed to Web::MREST::init
Web::MREST is designed to return status objects in the HTTP response entity. Before inclusion in the response, the status object is converted to JSON. This routine goes the opposite direction, taking a JSON string and converting it back into a status object.
FIXME: There may be some encoding issues here!
Assemble and process a HTTP request. Takes the following positional arguments:
* Plack::Test object * expected HTTP result code * user to authenticate with (can be 'root', 'demo', or 'active') * HTTP method * resource string * optional JSON string
If the HTTP result code is 200, the return value will be a status object, undef otherwise.
Low-level request generator
Check that the resource has on-line documentation (takes Plack::Test object and resource name without quotes)
To install Web::MREST, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Web::MREST
CPAN shell
perl -MCPAN -e shell install Web::MREST
For more information on module installation, please visit the detailed CPAN module installation guide.