simplify more stuff
[gitmo/Class-MOP.git] / t / 024_attribute_initializer.t
index 46f6c31..c61c7cb 100644 (file)
@@ -3,7 +3,7 @@ use warnings;
 
 use Scalar::Util 'blessed', 'reftype';
 
-use Test::More tests => 9;
+use Test::More;
 
 use Class::MOP;
 
@@ -16,25 +16,25 @@ This checks that the initializer is used to set the initial value.
 {
     package Foo;
     use metaclass;
-    
-    Foo->meta->add_attribute('bar' => 
+
+    Foo->meta->add_attribute('bar' =>
         reader      => 'get_bar',
         writer      => 'set_bar',
         initializer => sub {
             my ($self, $value, $callback, $attr) = @_;
-            
+
             ::isa_ok($attr, 'Class::MOP::Attribute');
             ::is($attr->name, 'bar', '... the attribute is our own');
-            
+
             $callback->($value * 2);
         },
-    );  
+    );
 }
 
 can_ok('Foo', 'get_bar');
-can_ok('Foo', 'set_bar');    
+can_ok('Foo', 'set_bar');
 
-my $foo = Foo->meta->construct_instance(bar => 10);
+my $foo = Foo->meta->new_object(bar => 10);
 is($foo->get_bar, 20, "... initial argument was doubled as expected");
 
 $foo->set_bar(30);
@@ -49,11 +49,4 @@ isa_ok($bar, 'Class::MOP::Attribute');
 ok($bar->has_initializer, '... bar has an initializer');
 is(reftype $bar->initializer, 'CODE', '... the initializer is a CODE ref');
 
-
-
-
-
-
-
-
-
+done_testing;