remove some undocumented apis from our tests
[gitmo/Class-MOP.git] / t / 303_RT_39001_fix.t
index f301cce..a3575e8 100644 (file)
@@ -1,9 +1,7 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
-use Test::More tests => 3;
-use Test::Exception;
+use Test::More;
+use Test::Fatal;
 
 use Class::MOP;
 
@@ -18,20 +16,25 @@ This tests a bug sent via RT #39001
     use metaclass;
 }
 
-throws_ok {
+like( exception {
     Foo->meta->superclasses('Foo');
-} qr/^Recursive inheritance detected/, "error occurs when extending oneself";
+}, qr/^Recursive inheritance detected/, "error occurs when extending oneself" );
 
 {
     package Bar;
     use metaclass;
 }
 
-lives_ok {
+# reset @ISA, so that calling methods like ->isa won't die (->meta does this
+# if DEBUG_NO_META is set)
+@Foo::ISA = ();
+
+is( exception {
     Foo->meta->superclasses('Bar');
-} "regular subclass";
+}, undef, "regular subclass" );
 
-throws_ok {
+like( exception {
     Bar->meta->superclasses('Foo');
-} qr/^Recursive inheritance detected/, "error occurs when Bar extends Foo, when Foo is a Bar";
+}, qr/^Recursive inheritance detected/, "error occurs when Bar extends Foo, when Foo is a Bar" );
 
+done_testing;