The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Test::Stream::Manual::ToTest2 - How to move code to Test2/Test2-Suite

DESCRIPTION

Test::Stream is deprecated in favor of Test2, Test2::Suite, and Test2::Workflow.

MAP

This section briefly tells you where to look for replacements.

THE GUTS AND INTERNALS

CONTEXT

If you used the context() method it can now be found in Test2::API, usage is identical. Converting from Test-Stream's context() function could be as easy as changing use Test::Stream::Context qw/context/ to use Test2::API qw/context/.

One major gotcha though is that the debug() attribute is gone. Instead there is a trace() attribute, but its usage is not identical.

TODO/SKIP

TODO and SKIP are no longer managed inside the Context and DebugInfo objects. Skip is now a full fledged event type Test2::Event::Skip, and Test2::API::Context has added a skip() method.

TODO is no longer tracked at all by the Test2 internals. Instead look at Test2::Tools::Todo and/or Test2::Todo which are both part of Test2::Suite. These tools manage TODO as a hub filter.

IPC

IPC has not changed much. Load the Test2::IPC module to make sure IPC is loaded if you need it.

CAPABILITIES

Test::Stream::Capabilities has been merged with Test::Stream::Util in Test2::Util.

EXPORTER

Test::Stream::Exporter is completely gone. Use Exporter, Export::Declare, Exporter::Declare, or Sub::Exporter.

HASHBASE

See Test2::Util::HashBase.

Change

    use Test::Stream::HashBase(
        base => 'Parent::Class',
        accessors => [qw/foo bar baz/],
    );

To

    use parent 'Parent::Class';
    use Test2::Util::HashBase qw/foo bar baz/;

EVENTS

See Test2::Event for the new event base class. Very little has changed apart from the HashBase usage.

SYNC

Test::Stream::Sync has been replaced by Test2::API. One major difference is that Test2::API exports functions, you do not call clas methods on it the way you did with Test2::Sync. Test2::API also adds and renames several functions.

HUB AND STATE

Test::Stream::Hub and Test::Stream::State have been merged into Test2::API::Stack. Methods form both are now in a single class. Some deprecated methods were removed.

TOOLS, PLUGINS, FORMATTERS, ETC.

There is a new namespace layout. Test::Stream::Plugin:: has been split into:

Test2::Tools::

Tools live here.

Test2::Bundle::

Bundles live here.

Test2::Plugin::

Plugins (behavior modifications) live here.

Test2::Require::

Things that cause a test to skip all live here.

Test2::Formatter::

Formatters live here.

-V1

Test::Stream::Bundle::V1 is now spelled Test2::Bundle::Extended.

-Classic

Test::Stream::Bundle::Classic is now spelled Test2::Bundle::Classic.

SPEC AND WORKFLOWS

All the spec and workflow stuff has moved to Test2::Workflow. This was never maked stable so I don't expect anyone to need a conversion guide.

TESTING YOUR TESTS

Test2::API now exports the $events = intercept { ... } function.

SOURCE

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

MAINTAINERS

Chad Granum <exodist@cpan.org>

AUTHORS

Chad Granum <exodist@cpan.org>

COPYRIGHT

Copyright 2015 Chad Granum <exodist7@gmail.com>.

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/