Test::...:Handle(3pm)

πŸ“¦
version 0.11 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

Test::TempDir::Handle πŸ’–

okay bestie, welcome to the User Contributed Perl Documentation corner of the internet, where we keep our lil temp dirs cute and contained ✨

✨ NAME ✨

Test::TempDir::Handle β€” it's literally just a handle for managing a temporary directory root πŸŽ€

🌸 VERSION 🌸

version 0.11 β€” yes she's vintage, and yes she still slays πŸ’…

πŸ¦‹ SYNOPSIS πŸ¦‹

use Test::TempDir::Handle;

my $h = Test::TempDir::Handle->new( dir => dir("t/tmp") );

$h->empty;

# ...

$h->cleanup; # will delete on success by default

no cap, that's the whole vibe. make a handle, empty it, do your lil tests, and let cleanup handle the rest 🫢


πŸ’œ DESCRIPTION πŸ’œ

So. This class manages a temporary directory. That's it, that's the whole job, and she does it beautifully πŸ‘‘


πŸŽ€ ATTRIBUTES πŸŽ€

  • dir β€” the Path::Class::Dir that is being managed. this is the actual directory she's babysitting, your main character folder fr fr πŸ“
  • lock β€” no longer used. yeah, she's retired, she's living her best life somewhere, we don't ask questions πŸ™ˆ
  • cleanup_policy β€” must be one of success, always or never.

and success means that cleanup deletes only if test_builder says the tests have passed. so like, she only throws away the evidence if you actually won πŸ’€

  • test_builder β€” the Test::Builder singleton. the one and only, the icon herself ⭐

πŸ’… METHODS πŸ’…

  • empty β€” cleans out the directory but doesn't delete it. she empties the bag but keeps the bag, iykyk πŸ‘œ
  • delete β€” cleans out the directory and removes it. full send, directory is GONE 🌈
  • cleanup β€” calls delete if the cleanup_policy dictates to do so.
heads up bestie: this is normally called automatically at destruction. so she does her lil cleanup solo when the object yeets itself 🧚

πŸ“ SUPPORT πŸ“

Bugs may be submitted through the RT bug tracker <https://rt.cpan.org/Public/Dist/Display.html?Name=Test-TempDir> (or bug-Test-TempDir@rt.cpan.org <mailto:bug-Test-TempDir@rt.cpan.org>). πŸ›

There is also a mailing list available for users of this distribution, at <http://lists.perl.org/list/perl-qa.html>. πŸ“¬

There is also an irc channel available for users of this distribution, at #perl on irc.perl.org <irc://irc.perl.org/#perl-qa>. πŸ’¬


πŸ‘‘ AUTHOR πŸ‘‘

XXXX XXX'XX (Yuval Kogman) <nothingmuch@woobling.org> β€” the legend herself 🫢


This software is copyright (c) 2006 by XXXX XXX'XX (Yuval Kogman). πŸ”₯

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay, honestly, that's the good licence energy πŸ’–


okay and that's a wrap, bestie 🌸 this whole page came to you courtesy of perl v5.34.0, dated 2022-07-11 β€” so she's been sitting here being iconic since way before you even opened this terminal ✨ mwah πŸ’…

πŸ“¦ where this page comes from