Test deposit() before testing withdraw()
Dave Rolsky [Sun, 10 Oct 2010 15:43:41 +0000 (11:43 -0400)]
moose-class/exercises/t/lib/MooseClass/Tests.pm

index 4fdf477..9fc3a8f 100644 (file)
@@ -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/,