Test::Class::Moose::Role - Test::Class::Moose for roles
version 0.55
If you need the functionality of Test::Class::Moose to be available inside of a role, this is the module to do that. This is how you can declare a TCM role:
package TestsFor::Basic::Role; use Test::Class::Moose::Role; sub test_in_a_role { my $test = shift; pass "This is picked up from role"; } sub in_a_role_with_tags : Tags(first){ fail "We should never see this test"; } sub test_in_a_role_with_tags : Tags(second){ pass "We should see this test"; } 1;
And to consume it:
package TestsFor::Basic::WithRole; use Test::Class::Moose; with qw/TestsFor::Basic::Role/; sub test_in_withrole { pass "Got here"; } 1;
Note that this cannot be consumed into classes and magically make them into test classes. You must still (at the present time) inherit from Test::Class::Moose to create a test suite.
Test::Class::Moose
Curtis "Ovid" Poe <ovid@cpan.org>
This software is copyright (c) 2014 by Curtis "Ovid" Poe.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Test::Class::Moose, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Class::Moose
CPAN shell
perl -MCPAN -e shell install Test::Class::Moose
For more information on module installation, please visit the detailed CPAN module installation guide.