Don't call ->does_role on meta object until we know it has that method
Dave Rolsky [Fri, 4 Feb 2011 22:24:26 +0000 (16:24 -0600)]
moose-class/exercises/t/lib/MooseClass/Tests.pm

index 06849e0..c3a333a 100644 (file)
@@ -328,7 +328,8 @@ sub tests06 {
     }
 
     ok(
-        $history_attr->meta()
+        $history_attr->meta()->can('does_role')
+            && $history_attr->meta()
             ->does_role('Moose::Meta::Attribute::Native::Trait::Array'),
         'BankAccount history attribute uses native delegation to an array ref'
     );