1Test::TempDir::Handle(3U)ser Contributed Perl DocumentatiToenst::TempDir::Handle(3)
2
3
4
6 Test::TempDir::Handle - A handle for managing a temporary directory
7 root.
8
10 use Test::TempDir::Handle;
11
12 my $h = Test::TempDir::Handle->new( dir => dir("t/tmp") );
13
14 $h->empty;
15
16 # ...
17
18 $h->cleanup; # will delete on success by default
19
21 This class manages a temporary directory.
22
24 dir The Path::Class::Dir that is being managed.
25
26 lock
27 An optional lock object (File::NFSLock). Just kept around for
28 reference counting.
29
30 cleanup_policy
31 One of "success", "always" or "never".
32
33 "success" means that "cleanup" deletes only if "test_builder" says
34 the tests have passed.
35
36 test_builder
37 The Test::Builder singleton.
38
40 empty
41 Cleans out the directory but doesn't delete it.
42
43 delete
44 Cleans out the directory and removes it.
45
46 cleanup
47 Calls "delete" if the "cleanup_policy" dictates to do so.
48
49 This is normally called automatically at destruction.
50
51
52
53perl v5.12.1 2009-08-10 Test::TempDir::Handle(3)