pass hashref to Attr->_new
[gitmo/Class-MOP.git] / t / 103_Perl6Attribute_test.t
index 6dd8976..3b14e26 100644 (file)
@@ -4,16 +4,17 @@ use strict;
 use warnings;
 
 use Test::More tests => 10;
+use File::Spec;
 
 BEGIN { 
     use_ok('Class::MOP');    
-    use_ok('examples::Perl6Attribute');
+    require_ok(File::Spec->catfile('examples', 'Perl6Attribute.pod'));
 }
 
 {
     package Foo;
     
-    use Class::MOP 'meta';
+    use metaclass;
     
     Foo->meta->add_attribute(Perl6Attribute->new('$.foo'));
     Foo->meta->add_attribute(Perl6Attribute->new('@.bar'));    
@@ -21,8 +22,8 @@ BEGIN {
     
     sub new  {
         my $class = shift;
-        bless $class->meta->construct_instance() => $class;
-    }        
+        $class->meta->new_object(@_);
+    }      
 }
 
 my $foo = Foo->new();