From: Rafael Kitover Date: Wed, 10 Feb 2010 20:04:33 +0000 (-0500) Subject: update t/030_roles/010_run_time_role_composition.t to check for ToInstance anon class... X-Git-Tag: 0.98~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=01e8a20b591e64aa4566a5e6904aaa7cb8d53b3d;p=gitmo%2FMoose.git update t/030_roles/010_run_time_role_composition.t to check for ToInstance anon class caching bug --- diff --git a/t/030_roles/010_run_time_role_composition.t b/t/030_roles/010_run_time_role_composition.t index 4ec636c..fbc3937 100644 --- a/t/030_roles/010_run_time_role_composition.t +++ b/t/030_roles/010_run_time_role_composition.t @@ -61,12 +61,12 @@ isa_ok($obj2, 'My::Class'); } { - ok(!$obj2->does('Bark'), '... we do not do any roles yet'); + ok(!$obj2->does('Sleeper'), '... we do not do any roles yet'); - Bark->meta->apply($obj2); + Sleeper->meta->apply($obj2); - ok($obj2->does('Bark'), '... we now do the Bark role'); - is(blessed($obj), blessed($obj2), '... they share the same anon-class/role thing'); + ok($obj2->does('Sleeper'), '... we now do the Sleeper role'); + isnt(blessed($obj), blessed($obj2), '... they DO NOT share the same anon-class/role thing'); } { @@ -81,7 +81,7 @@ isa_ok($obj2, 'My::Class'); ok(!My::Class->does('Sleeper'), '... the class does not do the Sleeper role'); - isnt(blessed($obj), blessed($obj2), '... they no longer share the same anon-class/role thing'); + isnt(blessed($obj), blessed($obj2), '... they still don\'t share the same anon-class/role thing'); isa_ok($obj, 'My::Class'); @@ -92,12 +92,12 @@ isa_ok($obj2, 'My::Class'); } { - ok(!$obj2->does('Sleeper'), '... we do not do any roles yet'); + ok(!$obj2->does('Bark'), '... we do not do Bark yet'); - Sleeper->meta->apply($obj2); + Bark->meta->apply($obj2); - ok($obj2->does('Sleeper'), '... we now do the Bark role'); - is(blessed($obj), blessed($obj2), '... they share the same anon-class/role thing again'); + ok($obj2->does('Bark'), '... we now do the Bark role'); + isnt(blessed($obj), blessed($obj2), '... they still don\'t share the same anon-class/role thing'); } done_testing; diff --git a/t/100_bugs/028_apply_role_to_instance_only.t b/t/100_bugs/028_apply_role_to_one_instance_only.t similarity index 100% rename from t/100_bugs/028_apply_role_to_instance_only.t rename to t/100_bugs/028_apply_role_to_one_instance_only.t