Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages

Manual Reference Pages  -  TEST::STREAM::STACK (3)

.ds Aq ’


Test::Stream::Stack - Object to manage a stack of Test::Stream::Hub instances.



<B>This distribution is deprecatedB> in favor of Test2, Test2::Suite, and Test2::Workflow.

See Test::Stream::Manual::ToTest2 for a conversion guide.


<B>The internals of this package are subject to change at any time!B> The public methods provided will not change in backwords incompatible ways, but the underlying implementation details might. <B>Do not break encapsulation here!B>


This module is used to represent and manage a stack of Test::Stream::Hub 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 = Test::Stream::Stack->new;
    my $hub = $stack->top;


$stack = Test::Stream::Stack->new() This will create a new empty stack instance. All arguments are ignored.
$hub = $stack->new_hub()
$hub = $stack->new_hub(%params)
$hub = $stack->new_hub(%params, class => $class) This will generate a new hub and push it to the top of the stack. Optionally you can provide arguments that will be passed into the constructor for the Test::Stream::Hub object.

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 Test::Stream::Sync will be used.

$hub = $stack->top() This will return the top hub from the stack. If there is no top hub yet this will create it.
$hub = $stack->peek() This will return the top hub from the stack. If there is no top hub yet this will return undef.
$stack->cull This will call $hub->cull on all hubs in the stack.
@hubs = $stack->all This will return all the hubs in the stack as a list.
$stack->clear This will completely remove all hubs from the stack. Normally you do not want to do this, but there are a few valid reasons for it.
$stack->push($hub) This will push the new hub onto the stack.
$stack->pop($hub) This will pop a hub from the stack, if the hub at the top of the stack does not match the hub you expect (passed in as an argument) it will throw an exception.


The source code repository for Test::Stream can be found at


Chad Granum <>


Chad Granum <>


Copyright 2015 Chad Granum <>.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


Search for    or go to Top of page |  Section 3 |  Main Index

perl v5.20.3 TEST::STREAM::STACK (3) 2016-02-05

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.