Author: dagolden
Date: Tue Mar 16 16:46:23 2010
New Revision: 13861
Modified:
Module-Build/trunk/Changes
Module-Build/trunk/t/lib/MBTest.pm
Log:
Sets $ENV{HOME} to a temporary directory during testing [David Golden]
Modified: Module-Build/trunk/Changes
==============================================================================
--- Module-Build/trunk/Changes (original)
+++ Module-Build/trunk/Changes Tue Mar 16 16:46:23 2010
@@ -9,6 +9,8 @@
- Added 'beos' to list of Unix-like os types (RT#53876) [Nigel Horne]
+ - Sets $ENV{HOME} to a temporary directory during testing [David Golden]
+
0.3603 - Mon Jan 18 22:28:59 EST 2010
(Oops, I released the last one before I realized this should have been
Modified: Module-Build/trunk/t/lib/MBTest.pm
==============================================================================
--- Module-Build/trunk/t/lib/MBTest.pm (original)
+++ Module-Build/trunk/t/lib/MBTest.pm Tue Mar 16 16:46:23 2010
@@ -12,6 +12,7 @@
BEGIN {
# Environment variables which might effect our testing
my @delete_env_keys = qw(
+ HOME
DEVEL_COVER_OPTIONS
MODULEBUILDRC
PERL_MB_OPT
@@ -123,6 +124,10 @@
return File::Temp::tempdir('MB-XXXXXXXX', CLEANUP => 1, DIR => $dir, @args);
}
+BEGIN {
+ $ENV{HOME} = tmpdir; # don't want .modulebuildrc or other things interfering
+}
+
sub save_handle {
my ($handle, $subr) = @_;
my $outfile = File::Spec->catfile(File::Spec->tmpdir, temp_file_name());