test that anon classes are the same for instances having the same roles applied in...
Rafael Kitover [Thu, 11 Feb 2010 22:48:01 +0000 (17:48 -0500)]
t/030_roles/010_run_time_role_composition.t

index fbc3937..a1dfd7c 100644 (file)
@@ -100,4 +100,14 @@ isa_ok($obj2, 'My::Class');
     isnt(blessed($obj), blessed($obj2), '... they still don\'t share the same anon-class/role thing');
 }
 
+# test that anon classes are equivalent after role composition in the same order
+{
+    foreach ($obj, $obj2) {
+        $_ = My::Class->new;
+        Bark->meta->apply($_);
+        Sleeper->meta->apply($_);
+    }
+    is(blessed($obj), blessed($obj2), '... they now share the same anon-class/role thing');
+}
+
 done_testing;