X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F020_basic_yaml.t;h=f26e1835446b8e87a66340b26482b7bc763e7392;hb=d3671a48f9673b8f5e74f9105b56406e4bfe5a6b;hp=a3c0e031da31f88f7c8c85e912edb78ca8c4bd25;hpb=f16b57403e78d22ab73a98b8714d2dae8e1ca207;p=gitmo%2FMooseX-Storage.git diff --git a/t/020_basic_yaml.t b/t/020_basic_yaml.t index a3c0e03..f26e183 100644 --- a/t/020_basic_yaml.t +++ b/t/020_basic_yaml.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' => 0.01, + 'Test::Without::Module' => 0.01, +}; BEGIN { - eval "use YAML::Any"; - plan skip_all => "YAML::Any is required for this test" if $@; - eval "use 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; @@ -53,8 +53,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'