From: Dave Rolsky Date: Fri, 4 Feb 2011 21:56:49 +0000 (-0600) Subject: Add test that Person preserves account object for 06 tests X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0235f94b35673a6a205180689f49df34059d6747;p=gitmo%2Fmoose-presentations.git Add test that Person preserves account object for 06 tests --- diff --git a/moose-class/exercises/t/lib/MooseClass/Tests.pm b/moose-class/exercises/t/lib/MooseClass/Tests.pm index 8beeabb..06849e0 100644 --- a/moose-class/exercises/t/lib/MooseClass/Tests.pm +++ b/moose-class/exercises/t/lib/MooseClass/Tests.pm @@ -672,9 +672,17 @@ sub employee03 { } sub person06 { + my $account = BankAccount->new(); + my $person = Person->new( first_name => 'Bilbo', last_name => 'Baggins', + account => $account, + ); + + is( + $person->account, $account, + 'account object passed to Person->new is still in object' ); isa_ok( $person->account, 'BankAccount' );