From: Karen Etheridge Date: Sun, 21 Nov 2010 08:50:53 +0000 (-0800) Subject: convert all uses of Test::Exception to Test::Fatal. X-Git-Tag: 0.31~3^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9d3c60f5f35a8d28951049e8daccd9f67c22f9aa;p=gitmo%2FMooseX-Storage.git convert all uses of Test::Exception to Test::Fatal. --- diff --git a/Changes b/Changes index dddaee2..cdd23c3 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,9 @@ Revision history for MooseX-Storage +{{NEXT}} + * The test suite now uses Test::Fatal instead of Test::Exception (Karen + Etheridge). + 0.29 * Remove use of Test::TempDir in favor of File::Temp (gphat) diff --git a/Makefile.PL b/Makefile.PL index fb4ba24..c29b9d1 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -43,7 +43,7 @@ author_tests 't/author'; build_requires 'Test::More' => '0.88'; build_requires 'Test::Deep' => '0'; -build_requires 'Test::Exception' => '0'; +build_requires 'Test::Fatal' => '0'; build_requires 'Test::Requires' => '0.05'; author_requires 'Test::Pod' => '1.14'; diff --git a/t/004_w_cycles.t b/t/004_w_cycles.t index f7e60c1..6dd816e 100644 --- a/t/004_w_cycles.t +++ b/t/004_w_cycles.t @@ -4,7 +4,7 @@ use strict; use warnings; use Test::More tests => 18; -use Test::Exception; +use Test::Fatal; BEGIN { use_ok('MooseX::Storage'); @@ -37,20 +37,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'); } { diff --git a/t/005_w_versions_and_authority_check.t b/t/005_w_versions_and_authority_check.t index 9dba061..7f4456f 100644 --- a/t/005_w_versions_and_authority_check.t +++ b/t/005_w_versions_and_authority_check.t @@ -4,7 +4,7 @@ use strict; use warnings; use Test::More tests => 8; -use Test::Exception; +use Test::Fatal; BEGIN { use_ok('MooseX::Storage'); @@ -84,7 +84,7 @@ Moose::Meta::Class->create('Bar', authority => 'cpan:JRANDOM', ); -dies_ok { +ok(exception { Foo->unpack( { __CLASS__ => 'Foo-0.01-cpan:JRANDOM', @@ -94,14 +94,14 @@ dies_ok { } } ); -} '... could not unpack, versions are different ' . $@; +}, '... could not unpack, versions are different ' . $@); Moose::Meta::Class->create('Bar', version => '0.01', authority => 'cpan:DSTATIC', ); -dies_ok { +ok(exception { Foo->unpack( { __CLASS__ => 'Foo-0.01-cpan:JRANDOM', @@ -111,4 +111,4 @@ dies_ok { } } ); -} '... could not unpack, authorities are different'; +}, '... could not unpack, authorities are different'); diff --git a/t/006_w_custom_type_handlers.t b/t/006_w_custom_type_handlers.t index d4f19b8..2583f80 100644 --- a/t/006_w_custom_type_handlers.t +++ b/t/006_w_custom_type_handlers.t @@ -4,7 +4,7 @@ use strict; use warnings; use Test::More tests => 9; -use Test::Exception; +use Test::Fatal; BEGIN { use_ok('MooseX::Storage'); diff --git a/t/008_do_not_serialize.t b/t/008_do_not_serialize.t index 4df3889..200e90b 100644 --- a/t/008_do_not_serialize.t +++ b/t/008_do_not_serialize.t @@ -4,7 +4,7 @@ use strict; use warnings; use Test::More tests => 13; -use Test::Exception; +use Test::Fatal; BEGIN { use_ok('MooseX::Storage'); diff --git a/t/009_do_not_serialize_lazy.t b/t/009_do_not_serialize_lazy.t index 54331bf..0e7fc7a 100644 --- a/t/009_do_not_serialize_lazy.t +++ b/t/009_do_not_serialize_lazy.t @@ -4,7 +4,7 @@ use strict; use warnings; use Test::More 'no_plan';#tests => 6; -use Test::Exception; +use Test::Fatal; BEGIN { use_ok('MooseX::Storage'); diff --git a/t/030_with_checksum.t b/t/030_with_checksum.t index f123821..eee46db 100644 --- a/t/030_with_checksum.t +++ b/t/030_with_checksum.t @@ -4,7 +4,7 @@ use strict; use warnings; use Test::More; -use Test::Exception; +use Test::Fatal; use Test::Deep; use Test::Requires { @@ -66,9 +66,9 @@ BEGIN { ); my $foo2; - lives_ok { + is( exception { $foo2 = Foo->unpack($packed); - } '... unpacked okay'; + }, undef, '... unpacked okay'); isa_ok($foo2, 'Foo'); cmp_deeply( diff --git a/t/200_combined_in_roles.t b/t/200_combined_in_roles.t index f36e1ac..edeeb65 100755 --- a/t/200_combined_in_roles.t +++ b/t/200_combined_in_roles.t @@ -2,7 +2,7 @@ use strict; use warnings; use Test::More tests => 1; -use Test::Exception; +use Test::Fatal; { package ClassOne; @@ -15,9 +15,9 @@ use Test::Exception; use MooseX::Storage; } -lives_ok { +is( exception { package CombineClasses; use Moose; with qw/ClassOne ClassTwo/; -} 'Can include two roles which both use MooseX::Storage'; +}, undef, 'Can include two roles which both use MooseX::Storage'); diff --git a/t/300_overloaded.t b/t/300_overloaded.t index b38ea7f..c1710a4 100644 --- a/t/300_overloaded.t +++ b/t/300_overloaded.t @@ -1,7 +1,7 @@ use strict; use warnings; use Test::More; -use Test::Exception; +use Test::Fatal; use Test::Requires { 'JSON::Any' => 0.01, # skip all if not installed @@ -27,9 +27,9 @@ use Test::Requires { my $i = Thing->new(foo => "bar"); -lives_ok { +is( exception { $i . ""; -} 'Can stringify without deep recursion'; +}, undef, 'Can stringify without deep recursion'); done_testing;