simplify more stuff
[gitmo/Class-MOP.git] / t / 106_LazyClass_test.t
index a941c40..b380d46 100644 (file)
@@ -1,39 +1,41 @@
 use strict;
 use warnings;
 
-use Test::More tests => 25;
+use Test::More;
 use File::Spec;
 
-BEGIN {use Class::MOP;    
+use Class::MOP;
+
+BEGIN {
     require_ok(File::Spec->catfile('examples', 'LazyClass.pod'));
 }
 
 {
     package BinaryTree;
-    
+
     use metaclass (
         'attribute_metaclass' => 'LazyClass::Attribute',
-        'instance_metaclass'  => 'LazyClass::Instance',        
+        'instance_metaclass'  => 'LazyClass::Instance',
     );
 
     BinaryTree->meta->add_attribute('node' => (
         accessor => 'node',
         init_arg => 'node'
     ));
-    
+
     BinaryTree->meta->add_attribute('left' => (
         reader  => 'left',
         default => sub { BinaryTree->new() }
     ));
-    
+
     BinaryTree->meta->add_attribute('right' => (
         reader  => 'right',
-        default => sub { BinaryTree->new() }    
-    ));    
+        default => sub { BinaryTree->new() }
+    ));
 
     sub new {
         my $class = shift;
-        bless $class->meta->construct_instance(@_) => $class;
+        bless $class->meta->new_object(@_) => $class;
     }
 }
 
@@ -78,3 +80,4 @@ is($root->right->node(), 2, '... the right node == 1');
 ok(!exists($root->right->{'left'}), '... left attribute still has not been initialized yet');
 ok(!exists($root->right->{'right'}), '... right attribute still has not been initialized yet');
 
+done_testing;