1Test::TempDir::Factory(U3s)er Contributed Perl DocumentatTieosnt::TempDir::Factory(3)
2
3
4
6 Test::TempDir::Factory - A factory for creating Test::TempDir::Handle
7 objects
8
10 version 0.10
11
13 my $f = Test::TempDir::Factory->new;
14
15 my $d = $f->create;
16
17 $d->empty;
18
19 # ...
20
21 $d->cleanup
22
24 This class creates Test::TempDir::Handle objects with the right "dir"
25 parameter, taking care of obtaining locks, creating directories, and
26 handling fallback logic.
27
29 "lock"
30 Whether or not to enable locking.
31
32 Defaults to true.
33
34 "lock_opts"
35 A hash reference to pass to File::NFSLock.
36
37 Defaults to "NONBLOCKING"
38
39 "lock_attempts"
40 How many times to try to create and lock a directory.
41
42 Defaults to 2.
43
44 "dir_name"
45 The directory under "t_dir" to use.
46
47 Defaults to "tmp"
48
49 "t_dir"
50 Defaults to "t"
51
52 "use_subdir"
53 Whether to always use a temporary subdirectory under the temporary
54 root.
55
56 This means that with a "success" cleanup policy all failures are
57 retained.
58
59 When disabled, "t/tmp" will be used directly as "temp_root".
60
61 Defaults to true.
62
63 "subdir_template"
64 The template to pass to "tempdir". Defaults to "File::Temp::TEMPXXX".
65
66 "handle_class"
67 Defaults to Test::TempDir::Handle.
68
69 "verbose"
70 Whether or not to "carp" diagnostics when falling back.
71
72 If you subclass this factory and add a "logger" method a la
73 MooseX::Logger then this parameter is ignored and all messages will be
74 "warn"ed on the logger.
75
77 "create"
78 Create a Test::TempDir::Handle object with a proper "dir" attribute.
79
81 יובל קוג'מן (Yuval Kogman) <nothingmuch@woobling.org>
82
84 This software is copyright (c) 2006 by יובל קוג'מן (Yuval Kogman).
85
86 This is free software; you can redistribute it and/or modify it under
87 the same terms as the Perl 5 programming language system itself.
88
89
90
91perl v5.30.0 2019-07-26 Test::TempDir::Factory(3)