CatalystX::Test::Most - Test base pulling in Catalyst::Test, Test::More, Test::Fatal, and HTTP::Request::Common for unit tests on Catalyst applications.
use CatalystX::Test::Most "MyApp"; subtest "Tests with plain Catalyst::Test" => sub { ok request("/")->is_success, "/ is okay"; is exception { request("/no-such-uri") }, undef, "404s do not throw exceptions"; is request("/no-such-uri")->code, 404, "And do return 404"; }; subtest "Tests with Test::WWW::Mechanize::Catalyst" => sub { my $mech = mech(); $mech->get_ok("/", "GET /"); $mech->content_contains("OHAI", "That's my app all right"); }; done_testing(); # ok 1 - / is okay # ok 2 - 404s do not throw exceptions # ok 3 - And do return 404 # 1..3 # ok 2 - Tests with plain Catalyst::Test # ok 1 - GET / # ok 2 - My app all right # 1..2 # ok 3 - Tests with Test::WWW::Mechanize::Catalyst
Everything, so see its documentation: Catalyst::Test. CatalystX::Test::Most is basically an overloaded version of it.
All of its exported functions; see its documentation: Test::More.
See exception in Test::Fatal.
exception
You have easy access to a Test::WWW::Mechanize::Catalyst object. There are no related functions, just the object methods.
ctx
This is a wrapper to get the context object. It will only work on local tests (not remote servers).
mech
Get a Test::WWW::Mechanize::Catalyst object. Unless specified, the app name and the arguments are recycled from the import of CatalystX::Test::Most.
import
strictures are exported.
Ashley Pond V. Artistic License 2.0.
To install CatalystX::Test::Most, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CatalystX::Test::Most
CPAN shell
perl -MCPAN -e shell install CatalystX::Test::Most
For more information on module installation, please visit the detailed CPAN module installation guide.