Test::S...:Bundle(3)

πŸ“¦
version 1.302027 Β· 2 versions
, in fedora 43

πŸ’– NAME πŸ’–

Test::Stream::Bundle β€” bestie, it's a lil toolkit that helps you write your own custom bundles. That's the whole vibe. ✨


🚫 DEPRECATED 🚫

Okay so real talk, this whole distribution is DEPRECATED. It's been benched in favor of Test2, Test2::Suite, and Test2::Workflow. πŸ’€

If you need to make the jump, there's a conversion guide waiting for you at Test::Stream::Manual::ToTest2. Go read it, it's giving helpful. 🫢


🌸 DESCRIPTION 🌸

So here's the tea: writing a bundle is how you cut down on all that boilerplate you keep copy-pasting everywhere. A bundle is literally just a set of plugins that all get loaded at once, exactly to your specifications. One line, whole squad of plugins, done. Iconic behavior honestly. πŸ’…


✨ SYNOPSIS ✨

package Test::Stream::Bundle::MyBundle;
use strict;
use warnings;

# Gives us an 'import' method that allows this module to be used directly
# if desired.
use Test::Stream::Bundle qw/import/;

sub plugins {
    return (
        qw{
            IPC
            TAP
            ExitSummary
            Core
            Context
            Exception
            Warnings
            Compare
            Mock
        },
    );
}

Look at that. Nine plugins, one sub plugins, zero stress. Chef's kiss. πŸŽ€


🎁 EXPORTS 🎁

  • $class->import() β€” okay so this import() method is what gets called when your plugin is used directly, like use Test::Stream::Bundle::MyBundle. When that happens, it loads up all the specified plugins for you. Automatic. Slay. πŸ¦‹

πŸ‘‘ EXPECTED METHODS πŸ‘‘

  • @list = $class->plugins() β€” your plugins() method should return a list of plugins to load. That's the main gig. But wait, there's more: it can also return coderefs, and those coderefs get run with the original caller arrayref as their only argument. ✨
sub plugins {
    return (
        qw/Core TAP .../,
        sub {
            my $caller = shift;

            # Package, file, and line that requested the bundle be used.
            my ($pkg, $file, $line) = @$caller;

            ...
        },
    );
}

Not me handing you the caller's package, file, and line like a little gift. 🎁 You literally know exactly who asked for the bundle and where from. Main character energy fr fr. πŸ’–


πŸ”— SOURCE πŸ”—

The source code repository for Test::Stream lives at http://github.com/Test-More/Test-Stream/. Go star it bestie. ⭐


🫢 MAINTAINERS 🫢

Chad Granum <exodist@cpan.org>


🌈 AUTHORS 🌈

Chad Granum <exodist@cpan.org>


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/


And that's the whole page, no cap. πŸ’… This one came from the User Contributed Perl Documentation collection and it's tagged perl v5.42.0, dated 2025-07-25 β€” so yeah, shoutout to that exact version and that exact day for bringing us this page. 🫢 Stay deprecated-but-fabulous, babe. πŸŽ€

πŸ“¦ where this page comes from