Test2::...:GenTemp(3)

πŸ“¦ version 1.302214, in opensuse-leap 16.0

πŸ’… Test2::Tools::GenTemp β€” the manual, but make it make sense

Ok so real talk, bestie: this is the page for Test2::Tools::GenTemp (from the Perl world, user-contributed docs, iykyk). Let me break it down for you πŸ’–


✨ NAME ✨

Test2::Tools::GenTemp β€” literally a tool for generating a populated temp directory. That's it, that's the whole vibe πŸŽ€

🌸 DESCRIPTION 🌸

This one exports a tool that helps you make a temporary directory, and then it'll also nest directories and text files inside it for you. No cap, it does the whole scaffolding thing so you don't have to 🫢

πŸ¦‹ SYNOPSIS πŸ¦‹

Here's the main character energy in action:

use Test2::Tools::GenTemp qw/gen_temp/;

my $dir = gen_temp(
    a_file => "Contents of a_file",
    a_dir  => {
        'a_file' => 'Contents of a_dir/afile',
        a_nested_dir => { ... },
    },
    ...
);

done_testing;

πŸ‘‘ EXPORTS πŸ‘‘

Every single sub here is exported by default β€” no asking, it just shows up 🌈

🧚 gen_temp(file => 'content', subdir => [ sub_dir_file => 'content', ...], ...)

🧚 gen_temp(-tempdir => \@TEMPDIR_ARGS, file => 'content', subdir => [ sub_dir_file => 'content', ...], ...)

This will generate a brand new temporary directory, loaded with all the files and subdirs you specify, recursively. Obsessed with the recursion tbh ✨

The initial temp directory is created using File::Temp::tempdir(), and if you want to pass arguments to tempdir, you do it with the -tempdir => [...] argument. That's the lil hookup right there πŸ’…

πŸ”₯ SOURCE πŸ”₯

The source code repository for Test2-Suite can be found at https://github.com/Test-More/test-more/. Go look, it's giving open source excellence 🫢

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


Ok that's a wrap bestie πŸŽ€ Ngl it's a cute little module. Version check for the record: perl v5.42.0, dated 2025-07-28 β€” that's the Test2::...:GenTemp(3) page, signed off, sealed, delivered πŸ’–βœ¨πŸ¦‹
πŸ“¦ where this page comes from