From: Christopher J. Madsen Date: Wed, 4 Jul 2012 04:48:16 +0000 (-0500) Subject: Test is_subtype_of on role_type of undefined role X-Git-Tag: 2.0800~37 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMoose.git;a=commitdiff_plain;h=985a810042f4dbc5865092e4bf76865d112f3432 Test is_subtype_of on role_type of undefined role This is the root issue in RT#77303 and RT#77299 --- diff --git a/t/type_constraints/role_type_constraint.t b/t/type_constraints/role_type_constraint.t index 23828f6..c10c4ff 100644 --- a/t/type_constraints/role_type_constraint.t +++ b/t/type_constraints/role_type_constraint.t @@ -65,6 +65,7 @@ ok( $type->is_subtype_of(Moose::Meta::TypeConstraint::Role->new( name => "__ANON my $type; is( exception { $type = role_type 'MyExampleRole' }, undef, 'Make initial role_type' ); is( exception { is(role_type('MyExampleRole'), $type, 're-running role_type gives same type') }, undef, 'No exception making duplicate role_type' );; + is( exception { ok( ! $type->is_subtype_of('Bar'), 'MyExampleRole is not a subtype of Bar' ) }, undef, 'No exception for is_subtype_of undefined role' ); } done_testing;