App::PAIA::Tester - facilitate PAIA testing
use Test::More; use App::PAIA::Tester; new_paia_test; # call with list paia qw(config base http://example.org/); # call with string and print call PAIA "config base http://example.org/"; is error, undef; paia qw(config); is_deeply stdout_json, { base => 'http://example.org/' }; paia qw(login -u alice -p 1234); is stderr, ''; is exit_code, 0; my $token = stdout_json->{access_token}; ok $token; note "token: $token"; done_paia_test;
The module implements a simple a singleton wrapper around App::Cmd::Tester to facilitate writing tests for and with the paia client App::PAIA.
paia
Execute paia with arguments given as list.
PAIA
Execute paia with arguments given as string and print the call before execution.
new_paia_test
Start a new test by changing into a new empty temporary directory and enabling paia_live.
paia_live
done_paia_test
Finish testing and print a summary.
paia_response
Set a mocked HTTP result to return for all following paia requests.
Disable HTTP request mocking.
stdout
Return the output sent to STDOUT by last paia execution.
stderr
Return the output sent to STDERR by last paia execution.
Return the combined output sent to STDOUT and STDERR by last paia execution.
stdout_json
Decode stdout, stripping lines starting with #, as JSON.
#
stderr_json
Decode stderr, stripping lines starting with #, as JSON.
output_json
Decode output, stripping lines starting with #, as JSON.
output
exit_code
Return the exit code of last paia execution (0 on success).
0
error
Return the exception thrown by last paia execution.
debug
Print stdout, stderr, error, and exit_code.
To install App::PAIA, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::PAIA
CPAN shell
perl -MCPAN -e shell install App::PAIA
For more information on module installation, please visit the detailed CPAN module installation guide.