X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F303_RT_39001_fix.t;h=a3575e887b9919e7c9d0b92d766003a32d527152;hb=46fccbab1ce2ee3a115b69e05a383f42dbf78890;hp=f301cce0be986fd653f59745d26307a0e4bf4a2b;hpb=efd3d14c1cf03120dfd1ed7787f8050e55bb8319;p=gitmo%2FClass-MOP.git diff --git a/t/303_RT_39001_fix.t b/t/303_RT_39001_fix.t index f301cce..a3575e8 100644 --- a/t/303_RT_39001_fix.t +++ b/t/303_RT_39001_fix.t @@ -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;