From: Dave Rolsky Date: Thu, 24 Sep 2009 21:11:44 +0000 (-0500) Subject: Actually test that bank account has a balance attr with a trigger X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=36e1e33638f7ec9f48ba61696e34b0393e8ddd48;p=gitmo%2Fmoose-presentations.git Actually test that bank account has a balance attr with a trigger --- diff --git a/moose-class/exercises/t/lib/MooseClass/Tests.pm b/moose-class/exercises/t/lib/MooseClass/Tests.pm index 100758a..22b544b 100644 --- a/moose-class/exercises/t/lib/MooseClass/Tests.pm +++ b/moose-class/exercises/t/lib/MooseClass/Tests.pm @@ -228,6 +228,13 @@ sub tests06 { has_ro_attr( 'BankAccount', 'history' ); } + my $ba_meta = BankAccount->meta; + ok( $ba_meta->has_attribute('balance'), + 'BankAccount class has a balance attribute' ); + + ok( $ba_meta->get_attribute('balance')->has_trigger, + 'BankAccount balance attribute has a trigger' ); + my $person_meta = Person->meta; ok( ! $person_meta->has_attribute('balance'), 'Person class does not have a balance attribute' );