use warnings;
use Test::More;
-use Test::Fatal;
+use Test::Exception;
use Scalar::Util 'blessed';
{
is(blessed($foo), 'Parent', 'Parent->new gives a Parent');
is($foo->whoami, "parent", 'Parent->whoami gives parent');
is($foo->parent, "parent", 'Parent->parent gives parent');
-ok exception { $foo->child }, "Parent->child method doesn't exist";
+dies_ok { $foo->child } "Parent->child method doesn't exist";
Child->meta->rebless_instance($foo);
is(blessed($foo), 'Child', 'rebless_instance really reblessed the instance');
is($foo->parent, "parent", 'reblessed->parent gives parent');
is($foo->child, "child", 'reblessed->child gives child');
-like exception { LeftField->meta->rebless_instance($foo) },
+throws_ok { LeftField->meta->rebless_instance($foo) }
qr/You may rebless only into a subclass of \(Child\), of which \(LeftField\) isn't\./;
-like exception { Class::MOP::Class->initialize("NonExistent")->rebless_instance($foo) },
+throws_ok { Class::MOP::Class->initialize("NonExistent")->rebless_instance($foo) }
qr/You may rebless only into a subclass of \(Child\), of which \(NonExistent\) isn't\./;
Parent->meta->rebless_instance_back($foo);
is(blessed($foo), 'Parent', 'Parent->new gives a Parent');
is($foo->whoami, "parent", 'Parent->whoami gives parent');
is($foo->parent, "parent", 'Parent->parent gives parent');
-ok exception { $foo->child }, "Parent->child method doesn't exist";
+dies_ok { $foo->child } "Parent->child method doesn't exist";
-like exception { LeftField->meta->rebless_instance_back($foo) },
+throws_ok { LeftField->meta->rebless_instance_back($foo) }
qr/You may rebless only into a superclass of \(Parent\), of which \(LeftField\) isn't\./;
-like exception { Class::MOP::Class->initialize("NonExistent")->rebless_instance_back($foo) },
+throws_ok { Class::MOP::Class->initialize("NonExistent")->rebless_instance_back($foo) }
qr/You may rebless only into a superclass of \(Parent\), of which \(NonExistent\) isn't\./;
# make sure our ->meta is still sane