From: Graham Knop Date: Mon, 17 Jun 2013 00:28:03 +0000 (-0400) Subject: use Test::Fatal instead of Test::Exception in all xt tests X-Git-Tag: v1.003000~46 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMoo.git;a=commitdiff_plain;h=97612fe26a8280865ff57f593919e893f6d40a85 use Test::Fatal instead of Test::Exception in all xt tests --- diff --git a/xt/handle_moose.t b/xt/handle_moose.t index 953b34a..397f2fd 100644 --- a/xt/handle_moose.t +++ b/xt/handle_moose.t @@ -1,5 +1,5 @@ use strictures 1; -use Test::Exception; +use Test::Fatal; BEGIN { require "t/moo-accessors.t"; } @@ -44,12 +44,12 @@ is($spoon->four, 4, 'Role application ok'); requires 'gun_dog'; } -lives_ok { +is exception { Moose::Util::apply_all_roles($meta, 'MooRequiresFour'); -} 'apply role with satisified requirement'; +}, undef, 'apply role with satisified requirement'; -dies_ok { +ok exception { Moose::Util::apply_all_roles($meta, 'MooRequiresGunDog'); -} 'apply role with unsatisified requirement'; +}, 'apply role with unsatisified requirement'; done_testing; diff --git a/xt/moose-accessor-isa.t b/xt/moose-accessor-isa.t index 5254948..ea7a0dc 100644 --- a/xt/moose-accessor-isa.t +++ b/xt/moose-accessor-isa.t @@ -1,8 +1,6 @@ use strictures 1; use Test::More; -use Test::Exception; - -use Moo::HandleMoose; +use Test::Fatal; { package FrewWithIsa; @@ -41,17 +39,17 @@ use Moo::HandleMoose; __PACKAGE__->meta->make_immutable; } -lives_ok { +is(exception { Bar->new(frooh => 1, frew => 1); -} 'creation of valid Bar'; +}, undef, 'creation of valid Bar'); -dies_ok { +ok exception { Bar->new(frooh => 'silly', frew => 1); -} 'creation of invalid Bar validated by coderef'; +}, 'creation of invalid Bar validated by coderef'; -dies_ok { +ok exception { Bar->new(frooh => 1, frew => 'goose'); -} 'creation of invalid Bar validated by quoted sub'; +}, 'creation of invalid Bar validated by quoted sub'; sub test_off_by_one { my ($class, $type) = @_; diff --git a/xt/moose-does-moo-role.t b/xt/moose-does-moo-role.t index 2330b30..07739da 100644 --- a/xt/moose-does-moo-role.t +++ b/xt/moose-does-moo-role.t @@ -1,8 +1,6 @@ use strictures 1; use Test::More; -use Test::Exception; - -use Moo::HandleMoose; +use Test::Fatal; { package MooParentRole; @@ -47,7 +45,7 @@ use Moo::HandleMoose; for my $parent (qw(MooseParent MooParent)) { for my $child (qw(MooRoledMooClass MooRoledMooseClass)) { - lives_and { + is(exception { my $o = $parent->new( e => $child->new(), ); @@ -56,7 +54,7 @@ for my $parent (qw(MooseParent MooParent)) { can_ok( $o->e, "parent_role_method" ); ok($o->e->meta->has_method('role_method'), 'Moose knows about role_method'); ok($o->e->meta->has_method('parent_role_method'), 'Moose knows about parent_role_method'); - }; + }, undef); } } diff --git a/xt/moose-lazy.t b/xt/moose-lazy.t index 20a2fa2..8e8475b 100644 --- a/xt/moose-lazy.t +++ b/xt/moose-lazy.t @@ -1,8 +1,5 @@ use strictures 1; use Test::More; -use Test::Exception; - -use Moo::HandleMoose; { package LazyFrew;