-#!/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::XS' => 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::XS";
- plan skip_all => "YAML::XS 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::XS');
plan tests => 10;
}
{
-
package Foo;
use Moose;
use MooseX::Storage;
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'