Test::Deep is already required; use it instead of is_deeply
[gitmo/MooseX-Storage.git] / t / 060_basic_deferred.t
index c8bbe33..e99973a 100644 (file)
@@ -5,15 +5,16 @@ use strict;
 use warnings;
 
 use Test::More;
+use Test::Deep;
 use Storable;
 
+use Test::Requires {
+    'Test::JSON' => 0.01, # skip all if not installed
+    'JSON::Any' => 0.01,
+    'YAML::Any' => 0.01,
+};
+
 BEGIN {
-    eval "use Test::JSON";
-    plan skip_all => "Test::JSON is required for this test" if $@;
-    eval "use JSON::Any";
-    plan skip_all => "JSON::Any is required for this test" if $@;
-    eval "use YAML::Any";
-    plan skip_all => "YAML::Any is required for this test" if $@;
     plan tests => 31;
     use_ok('MooseX::Storage');
 }
@@ -21,7 +22,6 @@ BEGIN {
 diag('Using implementation: ', YAML::Any->implementation);
 
 {
-
     package Foo;
     use Moose;
     use MooseX::Storage;
@@ -68,8 +68,8 @@ diag('Using implementation: ', YAML::Any->implementation);
     is( $foo->number, 10,    '... got the right number' );
     is( $foo->string, 'foo', '... got the right string' );
     is( $foo->float,  10.5,  '... got the right float' );
-    is_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' );
-    is_deeply(
+    cmp_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' );
+    cmp_deeply(
         $foo->hash,
         { map { $_ => undef } ( 1 .. 10 ) },
         '... got the right hash'
@@ -94,7 +94,7 @@ diag('Using implementation: ', YAML::Any->implementation);
     my $stored = $foo->freeze({ 'format' => 'Storable' });
 
     my $struct = Storable::thaw($stored);
-    is_deeply(
+    cmp_deeply(
         $struct,
         {
             '__CLASS__' => 'Foo',
@@ -132,8 +132,8 @@ diag('Using implementation: ', YAML::Any->implementation);
     is( $foo->number, 10,    '... got the right number' );
     is( $foo->string, 'foo', '... got the right string' );
     is( $foo->float,  10.5,  '... got the right float' );
-    is_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' );
-    is_deeply(
+    cmp_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' );
+    cmp_deeply(
         $foo->hash,
         { map { $_ => undef } ( 1 .. 10 ) },
         '... got the right hash'
@@ -163,8 +163,8 @@ diag('Using implementation: ', YAML::Any->implementation);
     is( $bar->number, 10,    '... got the right number' );
     is( $bar->string, 'foo', '... got the right string' );
     is( $bar->float,  10.5,  '... got the right float' );
-    is_deeply( $bar->array, [ 1 .. 10 ], '... got the right array' );
-    is_deeply(
+    cmp_deeply( $bar->array, [ 1 .. 10 ], '... got the right array' );
+    cmp_deeply(
         $bar->hash,
         { map { $_ => undef } ( 1 .. 10 ) },
         '... got the right hash'