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


POE-Test-Helpers documentation  | view source Contained in the POE-Test-Helpers distribution.

Index


NAME

Top

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

VERSION

Top

version 1.11

SYNOPSIS

Top

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

Top

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

Top

Sawyer, <xsawyerx at cpan.org>

BUGS

Top

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

Top

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/

ACKNOWLEDGEMENTS

Top

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

Top

  Sawyer X <xsawyerx@cpan.org>

COPYRIGHT AND LICENSE

Top


POE-Test-Helpers documentation  | view source Contained in the POE-Test-Helpers distribution.