Test2::Tools::GenTemp(3pm)

Test2::Tools::GenTemp3pm

Tool for generating a populated temp directory.

Usage

    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;

Overview

This exports a tool that helps you make a temporary directory, nested directories and text files within.

Exports

All subs are exported by default.

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 new temporary directory with all the files and subdirs you specify, recursively. The initial temp directory is created using File::Temp::tempdir(), you may pass arguments to tempdir using the "-tempdir => [...]" argument.

Source

The source code repository for Test2-Suite can be found at https://github.com/Test-More/test-more/.

Maintainers

Chad Granum <[email protected]>

Releases

4 releases since Debian 10 (Buster); the text changed 3 times.

  1. 10
  2. 11
  3. 12
  4. 13

Authors

Chad Granum <[email protected]>

From libtest-simple-perl 1.302210-1 in Debian 13 (Trixie). Also shipped by libtest2-suite-perl. Parsed by carta from the page's man source.