Test::Builder2::Event - A test event role
package My::Event; use Test::Builder2::Mouse; with 'Test::Builder2::Event'; sub as_hash { ... } sub event_type { return "thingy" }
Test::Builder2 is a federated system where multiple builders can define their own way to do asserts. They communicate and coordinate with each other by way of events. These events can include:
start of a test stream end of a test stream the result of an assert
The basic Event doesn't do a whole lot. It contains data and that's about it. Subclasses are expected to extend the interface quite a bit, but they will all be able to dump out their relevant data.
You must implement these methods.
my $type = $event->event_type;
Returns the type of event this is.
For example, "result".
my $data = $event->as_hash;
Returns all the data associated with this $event as a hash of attributes and values.
$event
The intent is to provide a way to dump all the information in an Event without having to call methods which may or may not exist.
my $id = $event->event_id;
Returns an identifier for this event unique to this process.
Useful if an EventWatcher posts its own events and doesn't want to process them twice.
Test::Builder2::Result
To install Test::Simple, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Simple
CPAN shell
perl -MCPAN -e shell install Test::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.