From: Dave Rolsky Date: Sun, 10 Oct 2010 15:43:41 +0000 (-0400) Subject: Test deposit() before testing withdraw() X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=507d2b5fcbdb0716926765694db6ab5276922adf;p=gitmo%2Fmoose-presentations.git Test deposit() before testing withdraw() --- diff --git a/moose-class/exercises/t/lib/MooseClass/Tests.pm b/moose-class/exercises/t/lib/MooseClass/Tests.pm index 4fdf477..9fc3a8f 100644 --- a/moose-class/exercises/t/lib/MooseClass/Tests.pm +++ b/moose-class/exercises/t/lib/MooseClass/Tests.pm @@ -683,6 +683,12 @@ sub account_tests { my $base_amount = shift || 0; $person->deposit(50); + + is( + $person->balance, 50 + $base_amount, + "balance is 50 + $base_amount", + ); + eval { $person->withdraw( 75 + $base_amount ) }; like( $@, qr/\QBalance cannot be negative/,