Test::...actory(3pm)

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

πŸ’– Test::TempDir::Factory πŸ’–

okay bestie so this is Test::TempDir::Factory (a 3pm perl manual page, iykyk) and it's literally a factory for making Test::TempDir::Handle objects ✨ no cap, that's the whole NAME situation.


✨ VERSION ✨

version 0.11 πŸŽ€


🌸 SYNOPSIS 🌸

ok so here's the vibe, copy-paste it into your little test file and watch it slay:

my $f = Test::TempDir::Factory->new;

my $d = $f->create;

$d->empty;

# ...

$d->cleanup

periodt πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

This class creates Test::TempDir::Handle objects with the correct dir parameter. That's it, that's the job β€” it makes the directories, and it handles the fallback logic. main character energy honestly πŸ‘‘


πŸ’œ ATTRIBUTES πŸ’œ

πŸ’€ lock

No longer used. rip to a real one πŸ™ˆ

πŸ’€ lock_opts

No longer used either, bestie. it's giving retirement party πŸŽ‰

Defaults to NONBLOCKING.

πŸ’€ lock_attempts

No longer used. fr fr.

Defaults to 2.

πŸ“ dir_name

The directory under t_dir to use.

Defaults to tmp 🌸

πŸ“ t_dir

Defaults to t.

πŸ—‚οΈ use_subdir

Whether to always use a temporary subdirectory under the temporary root.

This means that with a success cleanup policy, all failures are retained β€” so if something goes wrong you can still go look at it. iconic behaviour honestly 🫢

When disabled, t/tmp will be used directly as temp_root.

Defaults to true βœ…

🧚 subdir_template

The template to pass to tempdir. Defaults to File::Temp::TEMPXXX.

πŸŽ€ handle_class

Defaults to Test::TempDir::Handle.

πŸ”Š verbose

Whether or not to carp diagnostics when falling back.

If you subclass this factory and add a logger method a la MooseX::Logger, then this parameter is ignored and all messages will be warned on the logger instead. so like, choose your destiny ✨


πŸ”₯ METHODS πŸ”₯

🌟 create

Create a Test::TempDir::Handle object with a proper dir attribute. that's the one. that's the girlboss method πŸ‘‘


🫢 SUPPORT 🫢

Bugs may be submitted through the RT bug tracker at <https://rt.cpan.org/Public/Dist/Display.html?Name=Test-TempDir> β€” or if email is more your vibe, hit up bug-Test-TempDir@rt.cpan.org πŸ’Œ

There's also a mailing list available for users of this distribution, over at <http://lists.perl.org/list/perl-qa.html>. join the chat bestie 😭

And there's an irc channel available for users of this distribution too β€” #perl on irc.perl.org <irc://irc.perl.org/#perl-qa>. come hang out 🌈


πŸ‘‘ AUTHOR πŸ‘‘

XXXX XXX'XX (Yuval Kogman) <nothingmuch@woobling.org> β€” thank you for your service, legend πŸ’–


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 πŸ’…


and that's the whole page, bestie!! πŸŽ€ this masterpiece shipped as perl v5.34.0 and got its glow-up on 2022-07-11 β€” go forth and make temp dirs responsibly πŸ’–βœ¨πŸ¦‹
πŸ“¦ where this page comes from