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 <avarab@gmail.com>
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 $@;
=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;