metaclass and traits interpolation moved to Meta::Attribute
[gitmo/Moose.git] / t / 020_attributes / 009_attribute_inherited_slot_specs.t
index 2f1151f..0f1c33c 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 84;
+use Test::More tests => 85;
 use Test::Exception;
 
 BEGIN {
@@ -81,10 +81,18 @@ BEGIN {
         has '+one_last_one' => (isa => subtype('Ref', where { blessed $_ eq 'CODE' }));        
     } '... extend an attribute with anon-subtype';    
     
-    ::dies_ok {
+    ::lives_ok {
         has '+one_last_one' => (isa => 'Value');        
-    } '... cannot extend an attribute with a non-subtype';    
-    
+    } '... now can extend an attribute with a non-subtype';    
+
+    ::lives_ok {
+        has '+foo' => ( metaclass => 'DoNotSerialize' ); 
+    } 'Can add metaclass attribute option';
+
+    ::lives_ok {
+        has '+foo' => ( traits => [ 'DoNotSerialize' ] );
+    } 'Can add traits attribute option';   
     ::lives_ok {
         has '+bling' => (handles => ['hello']);        
     } '... we can add the handles attribute option';
@@ -93,19 +101,15 @@ BEGIN {
     ::dies_ok {
         has '+blang' => (handles => ['hello']);        
     } '... we can not alter the handles attribute option';    
-    ::dies_ok { 
+    ::lives_ok { 
         has '+fail' => (isa => 'Ref');           
-    } '... cannot create an attribute with an improper subtype relation';    
+    } '... can now create an attribute with an improper subtype relation';    
     ::dies_ok { 
         has '+other_fail' => (trigger => sub {});           
     } '... cannot create an attribute with an illegal option';    
     ::dies_ok { 
         has '+other_fail' => (weak_ref => 1);           
     } '... cannot create an attribute with an illegal option';   
-    ::dies_ok { 
-        has '+other_fail' => (isa => 'WangDoodle');           
-    } '... cannot create an attribute with a non-existent type';       
-    
 }
 
 my $foo = Foo->new;
@@ -193,8 +197,8 @@ ok(Bar->meta->has_attribute('gloum'), '... Bar has a gloum attr');
 ok(Bar->meta->has_attribute('bling'), '... Bar has a bling attr');
 ok(Bar->meta->has_attribute('bunch_of_stuff'), '... Bar does have a bunch_of_stuff attr');
 ok(!Bar->meta->has_attribute('blang'), '... Bar has a blang attr');
-ok(!Bar->meta->has_attribute('fail'), '... Bar does not have a fail attr');
-ok(!Bar->meta->has_attribute('other_fail'), '... Bar does not have a fail attr');
+ok(Bar->meta->has_attribute('fail'), '... Bar has a fail attr');
+ok(!Bar->meta->has_attribute('other_fail'), '... Bar does not have an other_fail attr');
 
 isnt(Foo->meta->get_attribute('foo'), 
      Bar->meta->get_attribute('foo'),