moving the scala mixins to a test only
[gitmo/Class-MOP.git] / t / 102_InsideOutClass_test.t
index dd09101..fcd877d 100644 (file)
@@ -4,35 +4,34 @@ use strict;
 use warnings;
 
 use Test::More tests => 19;
+use File::Spec;
 
 BEGIN { 
     use_ok('Class::MOP');    
-    use_ok('examples::InsideOutClass');
+    require_ok(File::Spec->catdir('examples', 'InsideOutClass.pod'));
 }
 
 {
     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(@_);
     }
 }