The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

POE::Test::Helpers::MooseRole - A Moose role for POE::Test::Helpers for MooseX::POE

VERSION

version 1.07

SYNOPSIS

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.

Attributes

tests

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'],
        },
    } } );

params_type

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.

AUTHOR

Sawyer, <xsawyerx at cpan.org>

BUGS

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.

SUPPORT

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

    perldoc POE::Test::Helpers

You can also look for information at:

ACKNOWLEDGEMENTS

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.

AUTHOR

  Sawyer X <xsawyerx@cpan.org>

COPYRIGHT AND LICENSE

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.