1Test::Stream::Stack(3)User Contributed Perl DocumentationTest::Stream::Stack(3)
2
3
4

NAME

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

DEPRECATED

10       This distribution is deprecated in favor of Test2, Test2::Suite, and
11       Test2::Workflow.
12
13       See Test::Stream::Manual::ToTest2 for a conversion guide.
14

***INTERNALS NOTE***

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

DESCRIPTION

22       This module is used to represent and manage a stack of
23       Test::Stream::Hub objects. Hubs are usually in a stack so that you can
24       push a new hub into place that can intercept and handle events
25       differently than the primary hub.
26

SYNOPSIS

28           my $stack = Test::Stream::Stack->new;
29           my $hub = $stack->top;
30

METHODS

32       $stack = Test::Stream::Stack->new()
33           This will create a new empty stack instance. All arguments are
34           ignored.
35
36       $hub = $stack->new_hub()
37       $hub = $stack->new_hub(%params)
38       $hub = $stack->new_hub(%params, class => $class)
39           This will generate a new hub and push it to the top of the stack.
40           Optionally you can provide arguments that will be passed into the
41           constructor for the Test::Stream::Hub object.
42
43           If you specify the "'class' => $class" argument, the new hub will
44           be an instance of the specified class.
45
46           Unless your parameters specify 'formatter' or 'ipc' arguments, the
47           formatter and ipc instance will be inherited from the current top
48           hub. You can set the parameters to "undef" to avoid having a
49           formatter or ipc instance.
50
51           If there is no top hub, and you do not ask to leave ipc and
52           formatter undef, then a new formatter will be created, and the IPC
53           instance from Test::Stream::Sync will be used.
54
55       $hub = $stack->top()
56           This will return the top hub from the stack. If there is no top hub
57           yet this will create it.
58
59       $hub = $stack->peek()
60           This will return the top hub from the stack. If there is no top hub
61           yet this will return undef.
62
63       $stack->cull
64           This will call "$hub->cull" on all hubs in the stack.
65
66       @hubs = $stack->all
67           This will return all the hubs in the stack as a list.
68
69       $stack->clear
70           This will completely remove all hubs from the stack. Normally you
71           do not want to do this, but there are a few valid reasons for it.
72
73       $stack->push($hub)
74           This will push the new hub onto the stack.
75
76       $stack->pop($hub)
77           This will pop a hub from the stack, if the hub at the top of the
78           stack does not match the hub you expect (passed in as an argument)
79           it will throw an exception.
80

SOURCE

82       The source code repository for Test::Stream can be found at
83       http://github.com/Test-More/Test-Stream/.
84

MAINTAINERS

86       Chad Granum <exodist@cpan.org>
87

AUTHORS

89       Chad Granum <exodist@cpan.org>
90
92       Copyright 2015 Chad Granum <exodist7@gmail.com>.
93
94       This program is free software; you can redistribute it and/or modify it
95       under the same terms as Perl itself.
96
97       See http://dev.perl.org/licenses/
98
99
100
101perl v5.34.0                      2022-01-21            Test::Stream::Stack(3)
Impressum