s/make_immutable/metaclass->make_immutable/
[gitmo/Moose.git] / t / 000_recipes / 004_recipe.t
index d68d211..b5a9af2 100644 (file)
@@ -45,7 +45,7 @@ BEGIN {
     has 'state'    => (is => 'rw', isa => 'USState');
     has 'zip_code' => (is => 'rw', isa => 'USZipCode');   
     
-    __PACKAGE__->meta->make_immutable(debug => 0);
+    metaclass->make_immutable(debug => 0);
 }{
     
     package Company;
@@ -54,9 +54,7 @@ BEGIN {
     
     has 'name'      => (is => 'rw', isa => 'Str', required => 1);
     has 'address'   => (is => 'rw', isa => 'Address'); 
-    has 'employees' => (is => 'rw', isa => subtype ArrayRef => where { 
-        (blessed($_) && $_->isa('Employee') || return) for @$_; 1 
-    });    
+    has 'employees' => (is => 'rw', isa => 'ArrayRef[Employee]');    
     
     sub BUILD {
         my ($self, $params) = @_;
@@ -82,7 +80,7 @@ BEGIN {
         }
     };
     
-    __PACKAGE__->meta->make_immutable(debug => 0);
+    metaclass->make_immutable(debug => 0);
 }{    
     
     package Person;
@@ -100,7 +98,7 @@ BEGIN {
                $self->last_name;
     }
 
-    __PACKAGE__->meta->make_immutable(debug => 0);
+    metaclass->make_immutable(debug => 0);
 }{
       
     package Employee;
@@ -116,7 +114,7 @@ BEGIN {
         super() . ', ' . $self->title
     };
     
-    __PACKAGE__->meta->make_immutable(debug => 0);
+    metaclass->make_immutable(debug => 0);
 }
 
 my $ii;