Test2::API::Stack - Object to manage a stack of L<Test2::Hub> instances. |
Test2::API::Stack - Object to manage a stack of the Test2::Hub manpage instances.
The internals of this package are subject to change at any time! The public methods provided will not change in backwards incompatible ways, but the underlying implementation details might. Do not break encapsulation here!
This module is used to represent and manage a stack of the Test2::Hub manpage objects. Hubs are usually in a stack so that you can push a new hub into place that can intercept and handle events differently than the primary hub.
my $stack = Test2::API::Stack->new; my $hub = $stack->top;
new()
new_hub()
new_hub(%params)
If you specify the 'class' => $class
argument, the new hub will be an
instance of the specified class.
Unless your parameters specify 'formatter'
or 'ipc'
arguments, the
formatter and IPC instance will be inherited from the current top hub. You can
set the parameters to undef
to avoid having a formatter or IPC instance.
If there is no top hub, and you do not ask to leave IPC and formatter undef, then a new formatter will be created, and the IPC instance from the Test2::API manpage will be used.
top()
peek()
$hub->cull
on all hubs in the stack.
push($hub)
pop($hub)
The source code repository for Test2 can be found at http://github.com/Test-More/test-more/.
Copyright 2019 Chad Granum <exodist@cpan.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://dev.perl.org/licenses/
Test2::API::Stack - Object to manage a stack of L<Test2::Hub> instances. |