From: Dave Rolsky Date: Wed, 23 Sep 2009 16:52:45 +0000 (-0500) Subject: Make it clear that some has_*_attr tests are looking for an overridden attribute. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=605c11448f61c020472d88a4056b740408ad7994;p=gitmo%2Fmoose-presentations.git Make it clear that some has_*_attr tests are looking for an overridden attribute. --- diff --git a/moose-class/exercises/t/lib/MooseClass/Tests.pm b/moose-class/exercises/t/lib/MooseClass/Tests.pm index d6f07c0..eaa8a24 100644 --- a/moose-class/exercises/t/lib/MooseClass/Tests.pm +++ b/moose-class/exercises/t/lib/MooseClass/Tests.pm @@ -60,7 +60,7 @@ sub tests03 { has_rw_attr( 'Person', 'title' ); - has_rw_attr( 'Employee', 'title' ); + has_rw_attr( 'Employee', 'title', 'overridden' ); has_rw_attr( 'Employee', 'salary_level' ); has_ro_attr( 'Employee', 'salary' ); @@ -271,10 +271,11 @@ sub check_isa { } sub has_rw_attr { - my $class = shift; - my $name = shift; + my $class = shift; + my $name = shift; + my $overridden = shift; - my $articled = A($name); + my $articled = $overridden ? "an overridden $name" : A($name); ok( $class->meta->has_attribute($name), "$class has $articled attribute" );