X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F020_basic_yaml_syck.t;h=4a5e284315b26d4509786963ddc25a189c89cf0a;hb=19d8a777247d4816be278da681de598526eaf1f2;hp=d94fcd2857f91567fc9babf4d7f0538a43596518;hpb=5cc94cf58b4c2ad212d5856335016475687353b2;p=gitmo%2FMooseX-Storage.git diff --git a/t/020_basic_yaml_syck.t b/t/020_basic_yaml_syck.t index d94fcd2..4a5e284 100644 --- a/t/020_basic_yaml_syck.t +++ b/t/020_basic_yaml_syck.t @@ -1,17 +1,17 @@ -#!/usr/bin/perl $|++; use strict; use warnings; use Test::More; +use Test::Deep; + +use Test::Requires { + 'YAML::Any' => 0.01, # skip all if not installed + 'YAML::Syck' => 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::Syck"; - plan skip_all => "YAML::Syck 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::Syck'); plan tests => 10; @@ -19,7 +19,6 @@ BEGIN { } { - package Foo; use Moose; use MooseX::Storage; @@ -53,8 +52,8 @@ BEGIN { 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'