Redo conversion to Test::Fatal
[gitmo/Class-MOP.git] / t / 305_RT_41255.t
index 676a27d..0c87b9d 100644 (file)
@@ -1,13 +1,11 @@
-#!/usr/bin/perl
-
 use strict;
-use Test::More tests => 20;
-use Test::Exception;
+use Test::More;
+use Test::Fatal;
 
 use Class::MOP;
 
 {
-    package Base;
+    package BaseClass;
     sub m1 { 1 }
     sub m2 { 2 }
     sub m3 { 3 }
@@ -15,7 +13,7 @@ use Class::MOP;
     sub m5 { 5 }
 
     package Derived;
-    use base qw(Base);
+    use base qw(BaseClass);
 
     sub m1;
     sub m2 ();
@@ -29,7 +27,7 @@ my %methods = map { $_ => $meta->find_method_by_name($_) } 'm1' .. 'm5';
 
 while (my ($name, $meta_method) = each %methods) {
     is $meta_method->fully_qualified_name, "Derived::${name}";
-    throws_ok { $meta_method->execute } qr/Undefined subroutine .* called at/;
+    like( exception { $meta_method->execute }, qr/Undefined subroutine .* called at/ );
 }
 
 {
@@ -47,5 +45,7 @@ EOC
 
 while (my ($name, $meta_method) = each %methods) {
     is $meta_method->fully_qualified_name, "Derived::${name}";
-    lives_ok { $meta_method->execute };
+    is( exception { $meta_method->execute }, undef );
 }
+
+done_testing;