From: Matt S Trout Date: Wed, 20 Jul 2011 04:40:24 +0000 (+0000) Subject: use Test::Fatal since we already need it X-Git-Tag: release_0.009009~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=204ca0d38067b0586461f3c258e56ef9ef1190dd;p=gitmo%2FRole-Tiny.git use Test::Fatal since we already need it --- diff --git a/t/accessor-reader-writer.t b/t/accessor-reader-writer.t index 68a0ae5..eed47f9 100644 --- a/t/accessor-reader-writer.t +++ b/t/accessor-reader-writer.t @@ -1,5 +1,6 @@ use strictures 1; use Test::More; +use Test::Fatal; my @result; @@ -33,7 +34,7 @@ is( $foo->get_one, 'lol', 'reader works' ); $foo->set_one('rofl'); is( $foo->get_one, 'rofl', 'writer works' ); -ok( !eval { $foo->get_one('blah'); 1 }, 'reader dies on write' ); +ok( exception { $foo->get_one('blah') }, 'reader dies on write' ); is( $bar->TWO, '...', 'accessor works for reading' ); $bar->TWO('!!!'); diff --git a/t/method-generate-accessor.t b/t/method-generate-accessor.t index 9c16b72..13ac5a8 100644 --- a/t/method-generate-accessor.t +++ b/t/method-generate-accessor.t @@ -28,7 +28,7 @@ like( my $foo = Foo->new(one => 1); is($foo->one, 1, 'ro reads'); -ok(!eval { $foo->one(-3); 1 }, 'ro dies on write attempt'); +ok(exception { $foo->one(-3) }, 'ro dies on write attempt'); is($foo->one, 1, 'ro does not write'); is($foo->two, undef, 'rw reads');