|o||To address perceived limitations in, and downfalls of, Test::Class.|
|o||To leverage existing Moose expertise for testing.|
|o||To bring Moose to the Perl testing game.|
In addition to exporting for Moose, Test::Able will export a handful of functions that can be used to declare test-related methods.
startup/setup/test/teardown/shutdown A more Moose-like way to do method declaration. The syntax is similar to has in Moose except its for test-related methods.
These start with one of startup/setup/test/teardown/shutdown depending on what type of method you are defining. Then comes any attribute name/value pairs to set in the Test::Able::Role::Meta::Method-based method metaclass object. The last pair must always be the method name and the coderef. This is to disambiguate between the method name/code pair and any another attribute in the method metaclass that happens to take a coderef. See the synopsis or the tests for examples.
1. Build some test classes: a, b, & c. The classes just have to be based on Test::Able.
2. Fire up an instance of any of them to be the runner object. Any test object can serve as the test_runner_object including itself.
my $b_obj = b->new;
3. Setup the test_objects in the test_runner_object.
$b_obj->test_objects( [ a->new, $b_obj, c->new, ] );
4. Do the test run. The test_objects will be run in order.
Test::Able::Cookbook support #moose on irc.perl.org code Moose Test::Class Test::Builder
Justin DeVuyst, firstname.lastname@example.org
Copyright 2009 by Justin DeVuyst.
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
|perl v5.20.3||TEST::ABLE (3)||2011-11-20|