X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F004_w_cycles.t;h=7987bbabb69772aae0058db584b7202614b2d3ee;hb=619ab942be0a8bd8f530c57ca5b0c8d833cdc89b;hp=12a4ca855ce9a1b33c64499538712d4c77c8aec4;hpb=1e1598d05052f71b0af1451107c352610306471c;p=gitmo%2FMooseX-Storage.git diff --git a/t/004_w_cycles.t b/t/004_w_cycles.t index 12a4ca8..7987bba 100644 --- a/t/004_w_cycles.t +++ b/t/004_w_cycles.t @@ -4,7 +4,8 @@ use strict; use warnings; use Test::More tests => 18; -use Test::Exception; +use Test::Deep; +use Test::Fatal; BEGIN { use_ok('MooseX::Storage'); @@ -37,20 +38,20 @@ This test demonstrates two things: $circular->cycle($circular); - throws_ok { + like(exception { $circular->pack; - } qr/^Basic Engine does not support cycles/, - '... cannot collapse a cycle with the basic engine'; + }, qr/^Basic Engine does not support cycles/, + '... cannot collapse a cycle with the basic engine'); } { my $packed_circular = { __CLASS__ => 'Circular' }; $packed_circular->{cycle} = $packed_circular; - throws_ok { + like( exception { Circular->unpack($packed_circular); - } qr/^Basic Engine does not support cycles/, - '... cannot expand a cycle with the basic engine'; + }, qr/^Basic Engine does not support cycles/, + '... cannot expand a cycle with the basic engine'); } { @@ -86,7 +87,7 @@ This test demonstrates two things: my $t = Tree->new(node => 100); isa_ok($t, 'Tree'); - is_deeply( + cmp_deeply( $t->pack, { __CLASS__ => 'Tree', @@ -100,12 +101,12 @@ This test demonstrates two things: $t->add_child($t2); - is_deeply($t->children, [ $t2 ], '... got the right children in $t'); + cmp_deeply($t->children, [ $t2 ], '... got the right children in $t'); is($t2->parent, $t, '... created the cycle correctly'); isa_ok($t2->parent, 'Tree'); - is_deeply( + cmp_deeply( $t->pack, { __CLASS__ => 'Tree', @@ -120,7 +121,7 @@ This test demonstrates two things: }, '... got the right packed version (with parent attribute skipped in child)'); - is_deeply( + cmp_deeply( $t2->pack, { __CLASS__ => 'Tree', @@ -155,7 +156,7 @@ This test demonstrates two things: " And unpacked again" ); } - my $pack = $double->pack( disable_cycle_check => 1 ); + my $pack = $double->pack( engine_traits => [qw/DisableCycleDetection/] ); ok( $pack, " Object packs when cycle check is disabled"); ok( Double->unpack( $pack ), " And unpacked again" );