more
[gitmo/Class-MOP.git] / t / 102_InsideOutClass_test.t
index a8cd234..fcd877d 100644 (file)
@@ -14,26 +14,24 @@ BEGIN {
 {
     package Foo;
     
-    sub meta { InsideOutClass->initialize($_[0]) }
-    
-    Foo->meta->add_attribute(
-        InsideOutClass::Attribute->new('foo' => (
-            accessor  => 'foo',
-            predicate => 'has_foo',
-        ))
+    use metaclass 'InsideOutClass' => (
+        ':attribute_metaclass' => 'InsideOutClass::Attribute'
     );
     
-    Foo->meta->add_attribute(
-        InsideOutClass::Attribute->new('bar' => (
-            reader  => 'get_bar',
-            writer  => 'set_bar',
-            default => 'FOO is BAR'            
-        ))
-    );    
+    Foo->meta->add_attribute('foo' => (
+        accessor  => 'foo',
+        predicate => 'has_foo',
+    ));
+    
+    Foo->meta->add_attribute('bar' => (
+        reader  => 'get_bar',
+        writer  => 'set_bar',
+        default => 'FOO is BAR'            
+    ));
     
     sub new  {
         my $class = shift;
-        bless $class->meta->construct_instance() => $class;
+        $class->meta->new_object(@_);
     }
 }