Test::S...n::Class(3)

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

πŸ’– Test::Stream::Plugin::Class πŸ’–

okay so bestie, welcome to the manual page for Test::Stream::Plugin::Class β€” a lil User Contributed Perl Documentation moment (yes, it lives in the Test::S...n::Class(3) slot, that's just the truncated vibe of the name, don't panic). Sit down, grab a strawberry πŸ“, and let's get into it.


✨ NAME ✨

Test::Stream::Plugin::Class β€” it's the plugin that loads the package you're testing and gives you cute lil aliases so you don't have to keep typing the whole name. iconic behaviour honestly πŸ’…


πŸ’€ DEPRECATED πŸ’€

okay so we have to have a serious moment. no cap, this distribution is deprecated. it's been retired in favor of Test2, Test2::Suite, and Test2::Workflow. rip to a real one 🫢

if you need to make the switch, there's a whole conversion guide waiting for you over at Test::Stream::Manual::ToTest2. go read it, bestie, your future self will thank you.


🌸 DESCRIPTION 🌸

so here's the tea: this plugin lets you designate a class as THE class you are testing. like, you point at it, and the plugin will:

  • load that class for you πŸ“¦
  • hand you shortcuts for accessing it πŸ”‘

and the plot twist? other plugins can also make use of the exports, so they get to be smarter too. teamwork makes the dream work fr fr ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

look at this beautiful little code moment:

use Test::Stream Class => ['Package::You::Are::Testing'];

# You can access the class name using either the $CLASS variable, or the
# CLASS() function.
can_ok(CLASS(), qr/foo bar/);
isa_ok($CLASS,  'Package::Parent');

the way you get the class name two whole ways β€” either the $CLASS variable or the CLASS() function. not me being obsessed with options πŸ˜­πŸ‘‘


πŸŽ€ EXPORTS πŸŽ€

here's what you get handed when you use this plugin:

  • $class = CLASS() β€” this function returns the class name. simple. elegant. slay.
  • $CLASS β€” this package variable contains the class name. it's giving main character energy in variable form πŸ’œ

πŸ”₯ SOURCE πŸ”₯

the source code repository for Test::Stream lives right here, bestie:

http://github.com/Test-More/Test-Stream/

go forth and browse 🌈


πŸ‘‘ 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/


quick vibe check: all the license stuff above is real and matters β€” don't skip it just because it's at the bottom of the page πŸ’…

and that's the whole page, bestie! πŸŽ€ this was Test::S...n::Class(3), coming to you from perl v5.42.0, dated 2025-07-25, part of the User Contributed Perl Documentation collection. mwah, take care of yourself and your test suites 🫢✨

πŸ“¦ where this page comes from