X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F303_RT_39001_fix.t;h=a3575e887b9919e7c9d0b92d766003a32d527152;hb=871e9eb5d05b8b9986b2de3f4095f65a31159c56;hp=f7e21e4cfb93f99097111786e27a8d3413001f58;hpb=643f2f94ab780ca0c247cd36a88b13cc51d5c0fc;p=gitmo%2FClass-MOP.git diff --git a/t/303_RT_39001_fix.t b/t/303_RT_39001_fix.t index f7e21e4..a3575e8 100644 --- a/t/303_RT_39001_fix.t +++ b/t/303_RT_39001_fix.t @@ -1,7 +1,7 @@ use strict; use warnings; -use Test::More tests => 3; -use Test::Exception; +use Test::More; +use Test::Fatal; use Class::MOP; @@ -16,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;