NAME
Test::TempDir::Handle - A handle for managing a temporary directory root.
SYNOPSIS
use Test::TempDir::Handle;
my $h = Test::TempDir::Handle->new( dir => dir("t/tmp") );
$h->empty;
# ...
$h->cleanup; # will delete on success by default
DESCRIPTION
This class manages a temporary directory.
ATTRIBUTES
- dir
-
The Path::Class::Dir that is being managed.
- lock
-
An optional lock object (File::NFSLock). Just kept around for reference counting.
- cleanup_policy
-
One of
success,alwaysornever.successmeans thatcleanupdeletes only iftest_buildersays the tests have passed. - test_builder
-
The Test::Builder singleton.
METHODS
- empty
-
Cleans out the directory but doesn't delete it.
- delete
-
Cleans out the directory and removes it.
- cleanup
-
Calls
deleteif thecleanup_policydictates to do so.This is normally called automatically at destruction.