X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F030_with_checksum.t;h=0715831195f0f01fe45841b86b42ecb282902c29;hb=1d4669291edf1495a90d5b110a6334b05ca1cc78;hp=f1238217200cf7ea51e638a9044dab71372e20de;hpb=0b1731882300cdb05aa9fe09716da7a9a03cd00d;p=gitmo%2FMooseX-Storage.git diff --git a/t/030_with_checksum.t b/t/030_with_checksum.t index f123821..0715831 100644 --- a/t/030_with_checksum.t +++ b/t/030_with_checksum.t @@ -1,15 +1,13 @@ -#!/usr/bin/perl - use strict; use warnings; use Test::More; -use Test::Exception; +use Test::Fatal; use Test::Deep; use Test::Requires { 'Digest' => 0.01, # skip all if not installed - 'Digest::SHA1' => 0.01, + 'Digest::SHA' => 0.00, 'JSON::Any' => 0.01, }; @@ -43,9 +41,9 @@ BEGIN { object => Foo->new( number => 2 ), ); isa_ok( $foo, 'Foo' ); - + my $packed = $foo->pack; - + cmp_deeply( $packed, { @@ -56,21 +54,21 @@ BEGIN { float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, - object => { - __CLASS__ => 'Foo', - __DIGEST__ => re('[0-9a-f]+'), - number => 2 - }, + object => { + __CLASS__ => 'Foo', + __DIGEST__ => re('[0-9a-f]+'), + number => 2 + }, }, '... got the right frozen class' ); my $foo2; - lives_ok { + is( exception { $foo2 = Foo->unpack($packed); - } '... unpacked okay'; + }, undef, '... unpacked okay'); isa_ok($foo2, 'Foo'); - + cmp_deeply( $foo2->pack, { @@ -81,14 +79,14 @@ BEGIN { float => 10.5, array => [ 1 .. 10 ], hash => { map { $_ => undef } ( 1 .. 10 ) }, - object => { - __CLASS__ => 'Foo', - __DIGEST__ => re('[0-9a-f]+'), - number => 2 - }, + object => { + __CLASS__ => 'Foo', + __DIGEST__ => re('[0-9a-f]+'), + number => 2 + }, }, '... got the right frozen class' - ); + ); } {