use Test::Requires in tests
[gitmo/Moose.git] / xt / author / test-my-dependents.t
index 814058c..a8ca16e 100644 (file)
@@ -7,9 +7,10 @@ use Test::More;
 plan skip_all => 'This test will not run unless you set MOOSE_TEST_MD to a true value'
     unless $ENV{MOOSE_TEST_MD};
 
-eval 'use Test::DependentModules qw( test_all_dependents test_module );';
-plan skip_all => 'This test requires Test::DependentModules'
-    if $@;
+use Test::Requires {
+    'Test::DependentModules' => '0.01', # skip all if not installed
+};
+use Test::DependentModules qw( test_all_dependents test_module );
 
 $ENV{PERL_TEST_DM_LOG_DIR} = abs_path('.');