use lib 't/lib', 'lib';
use Test::More;
-use Test::Exception;
+use Test::Fatal;
use File::Spec;
use File::Temp 'tempdir';
-BEGIN {
- eval "use Module::Refresh;";
- plan skip_all => "Module::Refresh is required for this test" if $@;
-}
+use Test::Requires {
+ 'Module::Refresh' => '0.01', # skip all if not installed
+};
=pod
is($_->meta->name, $_, '... initialized the meta correctly');
- lives_ok {
+ is( exception {
Module::Refresh->new->refresh_module($_ . '.pm')
- } '... successfully refreshed ' . $_;
+ }, undef, '... successfully refreshed ' );
} foreach @modules;
=pod
close FILE;
}
-lives_ok {
+is( exception {
Module::Refresh->new->refresh_module('TestBaz.pm')
-} '... successfully refreshed ' . $test_module_file;
+}, undef, '... successfully refreshed ' );
is(TestBaz->meta->name, 'TestBaz', '... initialized the meta correctly');
ok(TestBaz->meta->has_attribute('foo'), '... it has the foo attribute as well');