Revert "convert all uses of Test::Exception to Test::Fatal."
[gitmo/Class-MOP.git] / t / 003_methods.t
index de128e4..5340b44 100644 (file)
@@ -2,7 +2,7 @@ use strict;
 use warnings;
 
 use Test::More;
-use Test::Fatal;
+use Test::Exception;
 
 use Scalar::Util qw/reftype/;
 use Sub::Name;
@@ -74,9 +74,9 @@ my $foo = sub {'Foo::foo'};
 ok( !UNIVERSAL::isa( $foo, 'Class::MOP::Method' ),
     '... our method is not yet blessed' );
 
-ok ! exception {
+lives_ok {
     $Foo->add_method( 'foo' => $foo );
-},
+}
 '... we added the method successfully';
 
 my $foo_method = $Foo->get_method('foo');
@@ -210,7 +210,7 @@ is_deeply(
 is( $Foo->remove_method('foo')->body, $foo, '... removed the foo method' );
 ok( !$Foo->has_method('foo'),
     '... !Foo->has_method(foo) we just removed it' );
-ok exception { Foo->foo }, '... cannot call Foo->foo because it is not there';
+dies_ok { Foo->foo } '... cannot call Foo->foo because it is not there';
 
 is_deeply(
     [ sort $Foo->get_method_list ],
@@ -236,9 +236,9 @@ ok( $Bar->has_method('bar'), '... Bar->has_method(bar)' );
 is( Bar->foo, 'Bar::foo', '... Bar->foo == Bar::foo' );
 is( Bar->bar, 'Bar::bar', '... Bar->bar == Bar::bar' );
 
-ok ! exception {
+lives_ok {
     $Bar->add_method( 'foo' => sub {'Bar::foo v2'} );
-},
+}
 '... overwriting a method is fine';
 
 is_deeply( [ Class::MOP::get_code_info( $Bar->get_method('foo')->body ) ],