fix references to test files
[gitmo/Moose.git] / lib / Moose / Cookbook / Basics / Recipe2.pod
index d1b5617..255e91c 100644 (file)
@@ -1,9 +1,11 @@
+package Moose::Cookbook::Basics::Recipe2;
 
-=pod
+# ABSTRACT: A simple B<BankAccount> example
+
+__END__
 
-=head1 NAME
 
-Moose::Cookbook::Basics::Recipe2 - A simple B<BankAccount> example
+=pod
 
 =head1 SYNOPSIS
 
@@ -157,7 +159,7 @@ method, which accepts named parameters.
   );
 
 And as with the first recipe, a more in-depth example can be found in
-the F<t/000_recipes/moose_cookbook_basics_recipe2.t> test file.
+the F<t/recipes/moose_cookbook_basics_recipe2.t> test file.
 
 =head1 CONCLUSION
 
@@ -212,21 +214,6 @@ L<http://www.gigamonkeys.com/book/object-reorientation-generic-functions.html>
 
 =back
 
-=head1 AUTHORS
-
-Stevan Little E<lt>stevan@iinteractive.comE<gt>
-
-Dave Rolsky E<lt>autarch@urth.orgE<gt>
-
-=head1 COPYRIGHT AND LICENSE
-
-Copyright 2006-2009 by Infinity Interactive, Inc.
-
-L<http://www.iinteractive.com>
-
-This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself.
-
 =begin testing
 
 my $savings_account;
@@ -236,10 +223,13 @@ my $savings_account;
     isa_ok( $savings_account, 'BankAccount' );
 
     is( $savings_account->balance, 250, '... got the right savings balance' );
-    lives_ok {
-        $savings_account->withdraw(50);
-    }
-    '... withdrew from savings successfully';
+    is(
+        exception {
+            $savings_account->withdraw(50);
+        },
+        undef,
+        '... withdrew from savings successfully'
+    );
     is( $savings_account->balance, 200,
         '... got the right savings balance after withdrawl' );
 
@@ -262,20 +252,26 @@ my $savings_account;
     is( $checking_account->balance, 100,
         '... got the right checkings balance' );
 
-    lives_ok {
-        $checking_account->withdraw(50);
-    }
-    '... withdrew from checking successfully';
+    is(
+        exception {
+            $checking_account->withdraw(50);
+        },
+        undef,
+        '... withdrew from checking successfully'
+    );
     is( $checking_account->balance, 50,
         '... got the right checkings balance after withdrawl' );
     is( $savings_account->balance, 350,
         '... got the right savings balance after checking withdrawl (no overdraft)'
     );
 
-    lives_ok {
-        $checking_account->withdraw(200);
-    }
-    '... withdrew from checking successfully';
+    is(
+        exception {
+            $checking_account->withdraw(200);
+        },
+        undef,
+        '... withdrew from checking successfully'
+    );
     is( $checking_account->balance, 0,
         '... got the right checkings balance after withdrawl' );
     is( $savings_account->balance, 200,
@@ -297,17 +293,23 @@ my $savings_account;
     is( $checking_account->balance, 100,
         '... got the right checkings balance' );
 
-    lives_ok {
-        $checking_account->withdraw(50);
-    }
-    '... withdrew from checking successfully';
+    is(
+        exception {
+            $checking_account->withdraw(50);
+        },
+        undef,
+        '... withdrew from checking successfully'
+    );
     is( $checking_account->balance, 50,
         '... got the right checkings balance after withdrawl' );
 
-    dies_ok {
-        $checking_account->withdraw(200);
-    }
-    '... withdrawl failed due to attempted overdraft';
+    isnt(
+        exception {
+            $checking_account->withdraw(200);
+        },
+        undef,
+        '... withdrawal failed due to attempted overdraft'
+    );
     is( $checking_account->balance, 50,
         '... got the right checkings balance after withdrawl failure' );
 }