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 {

    event 'next' => sub {

    event 'last' => sub {

    package main;
    use Test::More tests => 3;
    use POE::Kernel;


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>


Please report any bugs or feature requests to bug-poe-test-simple at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

    perldoc POE::Test::Helpers

You can also look for information at:


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 <>


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.