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 version 0.10
11
13 use Test::TempDir::Handle;
14
15 my $h = Test::TempDir::Handle->new( dir => dir("t/tmp") );
16
17 $h->empty;
18
19 # ...
20
21 $h->cleanup; # will delete on success by default
22
24 This class manages a temporary directory.
25
27 "dir"
28 The Path::Class::Dir that is being managed.
29
30 "lock"
31 An optional lock object (File::NFSLock). Just kept around for reference
32 counting.
33
34 "cleanup_policy"
35 One of "success", "always" or "never".
36
37 "success" means that "cleanup" deletes only if "test_builder" says the
38 tests have passed.
39
40 "test_builder"
41 The Test::Builder singleton.
42
44 "empty"
45 Cleans out the directory but doesn't delete it.
46
47 "delete"
48 Cleans out the directory and removes it.
49
50 "cleanup"
51 Calls "delete" if the "cleanup_policy" dictates to do so.
52
53 This is normally called automatically at destruction.
54
56 יובל קוג'מן (Yuval Kogman) <nothingmuch@woobling.org>
57
59 This software is copyright (c) 2006 by יובל קוג'מן (Yuval Kogman).
60
61 This is free software; you can redistribute it and/or modify it under
62 the same terms as the Perl 5 programming language system itself.
63
64
65
66perl v5.30.0 2019-07-26 Test::TempDir::Handle(3)