Test2::...:EnvVar(3pm)

πŸ’– Test2::Require::EnvVar(3pm) πŸ’–

okay so hi bestie!! welcome to the Test2::Require::EnvVar(3pm) page from the Perl Programmers Reference Guide. this one is lowkey niche but highkey useful, iykyk πŸ’…

✨ NAME ✨

Test2::Require::EnvVar β€” only run a test when a specific environment variable is set. periodt.

🌸 DESCRIPTION 🌸

okay so the lore is: it's common practice to write tests that are only run when an environment variable is set. this module automates the (admittedly trivial) work of creating such a test. the way that it handles that tiny lil job is honestly a lil iconic, fr fr, no cap 🫢

vibe check: if you want a test that only runs when a specific environment variable is set, this is the helper for you. not me being obsessed with how simple that is 😭

πŸŽ€ SYNOPSIS πŸŽ€

use Test2::Require::EnvVar 'SOME_VAR';

...

done_testing;

ngl, that snippet ate and left no crumbs. you pass in 'SOME_VAR', and that's the demo. slay ✨

πŸ”₯ SOURCE πŸ”₯

the source code repository for Test2-Suite can be found at https://github.com/Test-More/test-more/. go be nosy, bestie β€” the repo is giving main character energy πŸ’–

πŸ‘‘ MAINTAINERS πŸ‘‘

  • Chad Granum β€” <exodist@cpan.org>

πŸ¦‹ AUTHORS πŸ¦‹

  • Chad Granum β€” <exodist@cpan.org>

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/.


made with πŸ’– for perl v5.42.3, dated 2026-11-03, and this iconic page is Test2::...:EnvVar(3pm) πŸ’…

πŸ“¦ where this page comes from