predicate fixes
[gitmo/Class-MOP.git] / t / 013_add_attribute_alternate.t
index 8b168c6..ca70fe2 100644 (file)
@@ -3,15 +3,16 @@
 use strict;
 use warnings;
 
-use Test::More tests => 27;
+use Test::More tests => 28;
 use Test::Exception;
 
 BEGIN {
-    use_ok('Class::MOP', ':universal');        
+    use_ok('Class::MOP');        
 }
 
 {
     package Point;
+    use metaclass;
 
     Point->meta->add_attribute('$.x' => (
         reader   => 'x',
@@ -72,7 +73,9 @@ is($point->y, 42, '... the $.y attribute was set properly with the accessor');
 
 is($point->x, 2, '... the $.x attribute was initialized correctly through the metaobject');
 
-$point->x(42);
+dies_ok {
+    $point->x(42);
+} '... cannot write to a read-only accessor';
 is($point->x, 2, '... the $.x attribute was not altered');
 
 $point->clear();