From: Chris Weyl Date: Sun, 24 Jan 2010 07:11:44 +0000 (-0800) Subject: Write out TestBaz.pm under the system tmp dir X-Git-Tag: 1.02~15 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bcbb26540134ab7e855785e1b24845301333dad9;p=gitmo%2FMoose.git Write out TestBaz.pm under the system tmp dir Writing out TestBaz.pm to somewhere the user is guaranteed to be able to write allows us to be able to keep the test suite around somewhere a non-root user can access and run it. Signed-off-by: Ævar Arnfjörð Bjarmason --- diff --git a/t/060_compat/001_module_refresh_compat.t b/t/060_compat/001_module_refresh_compat.t index 7ba1407..dae9fa6 100644 --- a/t/060_compat/001_module_refresh_compat.t +++ b/t/060_compat/001_module_refresh_compat.t @@ -8,6 +8,9 @@ use lib 't/lib', 'lib'; use Test::More; use Test::Exception; +use File::Spec; +use File::Temp 'tempdir'; + BEGIN { eval "use Module::Refresh;"; plan skip_all => "Module::Refresh is required for this test" if $@; @@ -38,7 +41,10 @@ and actually change the module itself. =cut -my $test_module_file = 'TestBaz.pm'; +my $dir = tempdir CLEANUP => 1; +push @INC, $dir; + +my $test_module_file = File::Spec->catdir($dir, 'TestBaz.pm'); my $test_module_source_1 = q| package TestBaz;