Test::TempDir::Handle - A handle for managing a temporary directory root.
use Test::TempDir::Handle; my $h = Test::TempDir::Handle->new( dir => dir("t/tmp") ); $h->empty; # ... $h->cleanup; # will delete on success by default
This class manages a temporary directory.
The Path::Class::Dir that is being managed.
An optional lock object (File::NFSLock). Just kept around for reference counting.
One of success, always or never.
success
always
never
success means that cleanup deletes only if test_builder says the tests have passed.
cleanup
test_builder
The Test::Builder singleton.
Cleans out the directory but doesn't delete it.
Cleans out the directory and removes it.
Calls delete if the cleanup_policy dictates to do so.
delete
cleanup_policy
This is normally called automatically at destruction.
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.