From: Robert 'phaylon' Sedlacek Date: Thu, 19 Feb 2009 01:03:38 +0000 (+0000) Subject: added Test::Exception prereq, replaced eval's in tests X-Git-Tag: 0.05~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a62f29758c55a65c74a877672e79ad0888369d95;p=gitmo%2FMooseX-Role-Parameterized.git added Test::Exception prereq, replaced eval's in tests --- diff --git a/dist.ini b/dist.ini index 897e6a5..73c0132 100644 --- a/dist.ini +++ b/dist.ini @@ -8,4 +8,5 @@ copyright_holder = Infinity Interactive [Prereq] Moose = 0.64 +Test::Exception = 0.27 diff --git a/t/150-composite-role-application.t b/t/150-composite-role-application.t index 05df310..98b1028 100644 --- a/t/150-composite-role-application.t +++ b/t/150-composite-role-application.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More tests => 9; +use Test::Exception; do { package MyCompositeRoleA; @@ -48,12 +49,10 @@ do { MyCompositeRoleB => { accessor => 'bar' }; }; -local $@; -eval { +lives_ok { ok(MyDoubleConsumer->can('foo'), 'first role in composite applied successfully'); ok(MyDoubleConsumer->can('bar'), 'second role in composite applied successfully'); -}; -ok !$@, 'testing composite roles lived'; +} 'testing composite roles lived'; do { package MyExtendingRole; @@ -82,12 +81,10 @@ do { MyExtendingRole => { foo => 23 }; }; -local $@; -eval { +lives_ok { ok(MyExtendedConsumer->can('bar'), 'role composed through other role applied successfully'); is(MyExtendedConsumer->new->foo, 23, 'role composing other role applied successfully'); -}; -ok !$@, 'testing role through application through other role lived'; +} 'testing role through application through other role lived'; do { package MyRoleProxy; @@ -117,10 +114,8 @@ do { ); }; -local $@; -eval { +lives_ok { ok(MyProxyConsumer->can('baz'), 'proxied role got applied successfully'); ok(MyProxyConsumer->can('qux'), 'other role besides proxied one got applied successfully'); -}; -ok !$@, 'testing proxied roles lived'; +} 'testing proxied roles lived';