1Test::Stream::Manual::TUosTeerstC2o(n3t)ributed Perl DocTuemsetn:t:aSttiroenam::Manual::ToTest2(3)
2
3
4
6 Test::Stream::Manual::ToTest2 - How to move code to Test2/Test2-Suite
7
9 Test::Stream is deprecated in favor of Test2, Test2::Suite, and
10 Test2::Workflow.
11
13 This section briefly tells you where to look for replacements.
14
15 THE GUTS AND INTERNALS
16 CONTEXT
17
18 If you used the "context()" method it can now be found in Test2::API,
19 usage is identical. Converting from Test-Stream's "context()" function
20 could be as easy as changing "use Test::Stream::Context qw/context/" to
21 "use Test2::API qw/context/".
22
23 One major gotcha though is that the "debug()" attribute is gone.
24 Instead there is a "trace()" attribute, but its usage is not identical.
25
26 TODO/SKIP
27
28 TODO and SKIP are no longer managed inside the Context and DebugInfo
29 objects. Skip is now a full fledged event type "Test2::Event::Skip",
30 and "Test2::API::Context" has added a "skip()" method.
31
32 TODO is no longer tracked at all by the Test2 internals. Instead look
33 at Test2::Tools::Todo and/or Test2::Todo which are both part of
34 Test2::Suite. These tools manage TODO as a hub filter.
35
36 IPC
37
38 IPC has not changed much. Load the Test2::IPC module to make sure IPC
39 is loaded if you need it.
40
41 CAPABILITIES
42
43 Test::Stream::Capabilities has been merged with Test::Stream::Util in
44 Test2::Util.
45
46 EXPORTER
47
48 Test::Stream::Exporter is completely gone. Use Exporter,
49 Export::Declare, Exporter::Declare, or Sub::Exporter.
50
51 HASHBASE
52
53 See Test2::Util::HashBase.
54
55 Change
56
57 use Test::Stream::HashBase(
58 base => 'Parent::Class',
59 accessors => [qw/foo bar baz/],
60 );
61
62 To
63
64 use parent 'Parent::Class';
65 use Test2::Util::HashBase qw/foo bar baz/;
66
67 EVENTS
68
69 See Test2::Event for the new event base class. Very little has changed
70 apart from the HashBase usage.
71
72 SYNC
73
74 Test::Stream::Sync has been replaced by Test2::API. One major
75 difference is that Test2::API exports functions, you do not call clas
76 methods on it the way you did with Test2::Sync. Test2::API also adds
77 and renames several functions.
78
79 HUB AND STATE
80
81 Test::Stream::Hub and Test::Stream::State have been merged into
82 Test2::API::Stack. Methods form both are now in a single class. Some
83 deprecated methods were removed.
84
85 TOOLS, PLUGINS, FORMATTERS, ETC.
86 There is a new namespace layout. "Test::Stream::Plugin::" has been
87 split into:
88
89 Test2::Tools::
90 Tools live here.
91
92 Test2::Bundle::
93 Bundles live here.
94
95 Test2::Plugin::
96 Plugins (behavior modifications) live here.
97
98 Test2::Require::
99 Things that cause a test to skip all live here.
100
101 Test2::Formatter::
102 Formatters live here.
103
104 -V1
105
106 Test::Stream::Bundle::V1 is now spelled Test2::Bundle::Extended.
107
108 -Classic
109
110 Test::Stream::Bundle::Classic is now spelled Test2::Bundle::Classic.
111
112 SPEC AND WORKFLOWS
113 All the spec and workflow stuff has moved to Test2::Workflow. This was
114 never maked stable so I don't expect anyone to need a conversion guide.
115
116 TESTING YOUR TESTS
117 Test2::API now exports the "$events = intercept { ... }" function.
118
120 The source code repository for Test::Stream can be found at
121 http://github.com/Test-More/Test-Stream/.
122
124 Chad Granum <exodist@cpan.org>
125
127 Chad Granum <exodist@cpan.org>
128
130 Copyright 2015 Chad Granum <exodist7@gmail.com>.
131
132 This program is free software; you can redistribute it and/or modify it
133 under the same terms as Perl itself.
134
135 See http://dev.perl.org/licenses/
136
137
138
139perl v5.32.1 2021-01-27 Test::Stream::Manual::ToTest2(3)