use Test::Requires in tests
[gitmo/MooseX-Storage.git] / t / 020_basic_yaml.t
index 9f60bf9..1cb5137 100644 (file)
@@ -5,13 +5,13 @@ use warnings;
 
 use Test::More;
 
+use Test::Requires {
+    'YAML::Any' => 0.01, # skip all if not installed
+    'YAML'      => 0.01,
+    'Test::Without::Module' => 0.01,
+};
+
 BEGIN {
-    eval "use YAML::Any";
-    plan skip_all => "YAML::Any is required for this test" if $@;
-    eval "require YAML";
-    plan skip_all => "YAML is required for this test" if $@;
-    eval "require Test::Without::Module";
-    plan skip_all => "Test::Without::Module is required for this test" if $@;
     Test::Without::Module->import(YAML::Any->order);
     Test::Without::Module->unimport('YAML');
     plan tests => 10;