
Test::TempDir - Temporary files support for testing.

use Test::TempDir;
my $test_tempdir = temp_root();
my ( $fh, $file ) = tempfile();
my $directory_scratch_obj = scratch();

Test::TempDir provides temporary directory creation with testing in mind.
The differences between using this and using File::Temp are:
t/tmp is available (writable, creatable, etc) it's preferred over $ENV{TMPDIR} etc. Otherwise a temporary directory will be used.
This is temp_root
t/tmp, to prevent race conditions when running under a parallel test harness.temp_root is cleaned at the end of a test run, but not if tests failed.temp_root is emptied at the begining of a test run unconditionally.tempfiles and tempdirs within temp_root, in order to aid in debugging of failed tests.
The root of the temporary stuff.
Wrappers for the File::Temp functions of the same name.
The default options are changed to use temp_root for DIR and disable CLEANUP, but these are overridable.
Loads Directory::Scratch and instantiates a new one, with the same default options as tempfile and tempdir.

File::Temp, Directory::Scratch, Path::Class

This module is maintained using Git. You can get the latest version from git://github.com/nothingmuch/test-tempdir.git.

Yuval Kogman <nothingmuch@woobling.org>

Copyright (c) 2008 Yuval Kogman. All rights reserved
This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.