use Test::More;
use Test::Exception;
-BEGIN {
- eval "use Module::Refresh;";
- plan skip_all => "Module::Refresh is required for this test" if $@;
-}
+use File::Spec;
+use File::Temp 'tempdir';
+
+use Test::Requires {
+ 'Module::Refresh' => '0.01', # skip all if not installed
+};
=pod
=cut
-my $test_module_file = 'TestBaz.pm';
+my $dir = tempdir( "MooseTest-XXXXX", CLEANUP => 1, TMPDIR => 1 );
+push @INC, $dir;
+
+my $test_module_file = File::Spec->catdir($dir, 'TestBaz.pm');
my $test_module_source_1 = q|
package TestBaz;
}
lives_ok {
- Module::Refresh->new->refresh_module($test_module_file)
+ Module::Refresh->new->refresh_module('TestBaz.pm')
} '... successfully refreshed ' . $test_module_file;
is(TestBaz->meta->name, 'TestBaz', '... initialized the meta correctly');