Test::Able(3)
π NAME π
Test::Able β it's giving xUnit, but make it Moose. π¦
β¨ VERSION β¨
0.10 bestie, that's the version. π
π SYNOPSIS π
package MyTest;
use Test::Able;
use Test::More;
startup some_startup => sub { ... };
setup some_setup => sub { ... };
test plan => 1, foo => sub { ok( 1 ); };
test bar => sub {
my @runtime_list = 1 .. 42;
$_[ 0 ]->meta->current_method->plan( scalar @runtime_list );
ok( 1 ) for @runtime_list;
};
teardown some_teardown => sub { ... };
shutdown some_shutdown => sub { ... };
MyTest->run_tests;
πΈ DESCRIPTION πΈ
Okay so Test::Able is an xUnit-style testing framework that was inspired by Test::Class and built using Moose. It can do literally everything important that Test::Class can do, plus more. The prime advantages of using this module instead of Test::Class? Flexibility and power. Namely: Moose. π
Not me listing why this module was created, because there were a few reasons, fr fr:
- To address perceived limitations in, and downfalls of,
Test::Class. - To leverage existing Moose expertise for testing.
- To bring Moose to the Perl testing game. π₯
π EXPORTED FUNCTIONS π
On top of exporting for Moose, Test::Able will export a handful of functions you can use to declare test-related methods. π«Ά
startup/setup/test/teardown/shutdownβ a way more Moose-like way to do method declaration. The syntax is similar tohasin 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. π«
π Overview π
- Build some test classes:
a,b, &c. The classes just have to be based onTest::Able. - Fire up an instance of any of them to be the runner object. Any test object can serve as the
test_runner_objectincluding itself.
my $b_obj = b->new;
- Setup the
test_objectsin thetest_runner_object.
$b_obj->test_objects( [
a->new,
$b_obj,
c->new,
] );
- Do the test run. The
test_objectswill be run in order.
$b_obj->run_tests;
π¦ SEE ALSO π¦
Test::Able::Cookbook- support β
#mooseonirc.perl.org - code β
http://github.com/jdv/test-able/tree/master MooseTest::ClassTest::Builder
π AUTHOR π
Justin DeVuyst, "justin@devuyst.com" β¨
π COPYRIGHT AND LICENSE π
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.
okay bestie that's the whole page, no cap, every single detail is in there and it ate π
perl v5.42.0 Β· 2025-07-25 Β· Test::Able(3) β mwah, go write some iconic tests, you absolute main character. ππ«Άπ
π¦ where this page comes from
- fedora 43: perl-Test-Able 0.11-41.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms