use warnings;
use Test::More;
-use Test::Fatal;
+use Test::Exception;
use Scalar::Util qw/reftype/;
use Sub::Name;
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');
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 ],
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 ) ],