From: Dave Rolsky Date: Fri, 4 Feb 2011 22:24:26 +0000 (-0600) Subject: Don't call ->does_role on meta object until we know it has that method X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4f7392e8862c4abe95b8e80571896eb7304075e7;p=gitmo%2Fmoose-presentations.git Don't call ->does_role on meta object until we know it has that method --- diff --git a/moose-class/exercises/t/lib/MooseClass/Tests.pm b/moose-class/exercises/t/lib/MooseClass/Tests.pm index 06849e0..c3a333a 100644 --- a/moose-class/exercises/t/lib/MooseClass/Tests.pm +++ b/moose-class/exercises/t/lib/MooseClass/Tests.pm @@ -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' );