no need for this to be a footnote, since we talk about it above now
[gitmo/Moose.git] / lib / Moose / Cookbook / Basics / Recipe3.pod
index 1028ecd..31832d3 100644 (file)
@@ -1,9 +1,11 @@
+package Moose::Cookbook::Basics::Recipe3;
 
-=pod
+# ABSTRACT: A lazy B<BinaryTree> example
+
+__END__
 
-=head1 NAME
 
-Moose::Cookbook::Basics::Recipe3 - A lazy B<BinaryTree> example
+=pod
 
 =head1 SYNOPSIS
 
@@ -182,7 +184,7 @@ ensure that is has the correct value for its C<parent> attribute.
 
 As with all the other recipes, B<BinaryTree> can be used just like any
 other Perl 5 class. A more detailed example of its usage can be found
-in F<t/000_recipes/moose_cookbook_basics_recipe3.t>.
+in F<t/recipes/moose_cookbook_basics_recipe3.t>.
 
 =head1 CONCLUSION
 
@@ -214,21 +216,6 @@ L<Moose::Cookbook::Basics::Recipe8> for details.
 
 =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-2010 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
 
 use Scalar::Util 'isweak';
@@ -261,9 +248,13 @@ ok(!$left->has_right, '... $left no right node yet');
 
 is($left->node, undef, '... left has got no node value');
 
-lives_ok {
-    $left->node('left')
-} '... assign to lefts node';
+is(
+    exception {
+        $left->node('left');
+    },
+    undef,
+    '... assign to lefts node'
+);
 
 is($left->node, 'left', '... left now has a node value');
 
@@ -278,9 +269,13 @@ ok($root->has_right, '... now we have a right node');
 my $right = $root->right;
 isa_ok($right, 'BinaryTree');
 
-lives_ok {
-    $right->node('right')
-} '... assign to rights node';
+is(
+    exception {
+        $right->node('right');
+    },
+    undef,
+    '... assign to rights node'
+);
 
 is($right->node, 'right', '... left now has a node value');
 
@@ -310,9 +305,13 @@ ok(isweak($left_left->{parent}), '... parent is a weakened ref');
 my $left_right = BinaryTree->new;
 isa_ok($left_right, 'BinaryTree');
 
-lives_ok {
-    $left->right($left_right)
-} '... assign to rights node';
+is(
+    exception {
+        $left->right($left_right);
+    },
+    undef,
+    '... assign to rights node'
+);
 
 ok($left_right->has_parent, '... left does have a parent');
 
@@ -324,9 +323,13 @@ ok(isweak($left_right->{parent}), '... parent is a weakened ref');
 
 # and check the error
 
-dies_ok {
-    $left_right->right($left_left)
-} '... cant assign a node which already has a parent';
+isnt(
+    exception {
+        $left_right->right($left_left);
+    },
+    undef,
+    '... cannot assign a node which already has a parent'
+);
 
 =end testing