Test2::Tools::Class - Test2 implementation of the tools for testing classes.
Test2 based tools for validating classes and objects. These are similar to some tools from Test::More, but they have a more consistent interface.
use Test2::Tools::Class; isa_ok($CLASS_OR_INSTANCE, $PARENT_CLASS1, $PARENT_CLASS2, ...); can_ok($CLASS_OR_INSTANCE, $METHOD1, $METHOD2, ...); DOES_ok($CLASS_OR_INSTANCE, $ROLE1, $ROLE2, ...);
All subs are exported by default.
This checks that $thing (either a class name, or a blessed instance) has the specified methods.
$thing
This checks that $thing (either a class name, or a blessed instance) is or subclasses the specified classes.
This checks that $thing (either a class name, or a blessed instance) does the specified roles.
Note 1: This uses the $class->DOES(...) method, not the does() method Moose provides.
$class->DOES(...)
does()
Note 2: Not all perls have the DOES() method, if you use this on those perls the test will be skipped.
DOES()
The source code repository for Test2-Suite can be found at http://github.com/Test-More/Test2-Suite/.
Copyright 2015 Chad Granum <exodist@cpan.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://dev.perl.org/licenses/
To install Test2::Suite, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test2::Suite
CPAN shell
perl -MCPAN -e shell install Test2::Suite
For more information on module installation, please visit the detailed CPAN module installation guide.