Test::TempDir::Factory - A factory for creating Test::TempDir::Handle objects.
my $f = Test::TempDir::Factory->new; my $d = $f->create; $d->empty; # ... $d->cleanup
This class creates Test::TempDir::Handle objects with the right dir parameter, taking care of obtaining locks, creating directories, and handling fallback logic.
dir
Whether or not to enable locking.
Defaults to true.
A hash reference to pass to File::NFSLock.
Defaults to NONBLOCKING
NONBLOCKING
How many times to try to create and lock a dir.
Defaults to 2.
The directory under t_dir to use.
t_dir
Defaults to tmp
tmp
Defaults to t
t
Whether to always use a temporary subdirectory under the temporary root.
This means that with a success cleanup policy all failures are retained.
success
When disabled, t/tmp will be used directly as temp_root.
t/tmp
temp_root
The template to pass to tempdir. Defaults to File::Temp::TEMPXXX.
tempdir
File::Temp::TEMPXXX
Defaults to Test::TempDir::Handle.
Whether or not to carp diagnostics when falling back.
carp
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.
logger
warn
Create a Test::TempDir::Handle object with a proper dir attribute.
To install Test::TempDir, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::TempDir
CPAN shell
perl -MCPAN -e shell install Test::TempDir
For more information on module installation, please visit the detailed CPAN module installation guide.