Test2::Bundle(3perl)
π Test2::Bundle β the tea on bundles π
ok so this is a page from the Perl Programmers Reference Guide, and we're talking about Test2::Bundle, bestie. sit down, grab a strawberry π, it's gonna be cute and it's gonna be thorough.
β¨ NAME β¨
Test2::Bundle β the docs for bundles, periodt.
π¦ DESCRIPTION π¦
okay so picture this: a bundle is literally just a collection of Tools and Plugins. that's it. that's the whole job. π
and here's the rule, no cap β bundles should not provide any tools or behaviors of their own. like, zero original content, bestie. they should simply combine the tools and the behaviors of other packages. it's giving group project where everyone else did the work and the bundle just put its name on it π .
πΈ FAQ πΈ
Should my bundle subclass Test2::Bundle?
no. π βοΈ
currently this class is empty. like, fully empty. eventually they might want to add behavior, and in that case they do not want anyone to already be subclassing it. so don't. iykyk. π
π₯ HOW DO I WRITE A BUNDLE? π₯
bestie writing a bundle can be so simple. watch this:
package Test2::Bundle::MyBundle;
use strict;
use warnings;
use Test2::Plugin::ExitSummary; # Load a plugin
use Test2::Tools::Basic qw/ok plan done_testing/;
# Re-export the tools
our @EXPORTS = qw/ok plan done_testing/;
use base 'Exporter';
1;
that's it. that's the bundle. it loaded a plugin with use Test2::Plugin::ExitSummary;, it pulled in tools from Test2::Tools::Basic with qw/ok plan done_testing/, and then it re-exported them with our @EXPORTS = qw/ok plan done_testing/; plus use base 'Exporter';. slay. π
now β if you wanna do anything more complex than that, you should look into Import::Into and Symbol::Move. those are your big-girl tools, go off. π§
π SOURCE π
the source code repository for Test2-Suite lives at https://github.com/Test-More/test-more/. go lurk, it's iconic.
π MAINTAINERS π
Chad Granum <exodist@cpan.org>
π AUTHORS π
Chad Granum <exodist@cpan.org>
π COPYRIGHT π
Copyright Chad Granum <exodist@cpan.org>.
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/
ok that's the whole page, you ate it, you understood it, you're basically a bundle expert now π«Ά
sign-off time: this was perl v5.44.0, dated 2026-10-17, and it's the Test2::Bundle(3perl) page from the Perl Programmers Reference Guide. mwah. πβ¨
π¦ where this page comes from
- arch rolling: perl 5.44.0-1 Β· Artistic-1.0-Perl AND GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms