POE::Test::Helpers::MooseRole - A Moose role for POE::Test::Helpers for MooseX::POE
version 1.11
This provides a Moose role for any MooseX::POE applications.
package MySession; use MooseX::POE; with 'POE::Test::Helpers::MooseRole'; has '+tests' => ( default => sub { { next => { count => 1 }, last => { count => 1, deps => ['next'] }, } } ); event 'START' => sub { $_[KERNEL]->yield('next'); }; event 'next' => sub { $_[KERNEL]->yield('last'); }; event 'last' => sub { ... }; package main; use Test::More tests => 3; use POE::Kernel; MySession->new(); POE::Kernel->run(); ...
In order to use it, you must consume the role (using with) and then change the following attributes.
This is a hash reference that includes all the tests you want to run. You should read the documentation in POE::Test::Helpers to understand what are the accepted formats.
Here are some examples:
has '+tests' => ( default => sub { { hello => { count => 1 }, there => { params => ['hello'] }, world => { count => 2, params => ['hello'], }, } } );
This is a simple string which controls how the event_params will go. Meanwhile it can only be set to "ordered" and "unordered". This might change in the future, be warned.
Basically this means that you don't care about the order of how the parameters get there, but only that whenever the event was run, it had one of the sets of parameters.
Sawyer, <xsawyerx at cpan.org>
<xsawyerx at cpan.org>
Please report any bugs or feature requests to bug-poe-test-simple at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=POE-Test-Helpers. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-poe-test-simple at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc POE::Test::Helpers
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=POE-Test-Helpers
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/POE-Test-Helpers
CPAN Ratings
http://cpanratings.perl.org/d/POE-Test-Helpers
Search CPAN
http://search.cpan.org/dist/POE-Test-Helpers/
I owe a lot of thanks to the following people:
Chris (perigrin) Prather
Thanks for all the comments and ideas. Thanks for MooseX::POE!
Rocco (dngor) Caputo
Thanks for the input and ideas. Thanks for POE!
#moose and #poe
Really great people and constantly helping me with stuff, including one of the core principles in this module.
Sawyer X <xsawyerx@cpan.org>
This software is copyright (c) 2010 by Sawyer X.
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 POE::Test::Helpers, copy and paste the appropriate command in to your terminal.
cpanm
cpanm POE::Test::Helpers
CPAN shell
perl -MCPAN -e shell install POE::Test::Helpers
For more information on module installation, please visit the detailed CPAN module installation guide.