Merge branch 'stable'
[gitmo/Class-MOP.git] / t / 013_add_attribute_alternate.t
index f133d3e..f7ecde1 100644 (file)
@@ -1,8 +1,8 @@
 use strict;
 use warnings;
 
-use Test::More tests => 27;
-use Test::Exception;
+use Test::More;
+use Test::Fatal;
 
 use Class::MOP;
 
@@ -28,12 +28,12 @@ use Class::MOP;
     sub clear {
         my $self = shift;
         $self->{'x'} = 0;
-        $self->{'y'} = 0;            
+        $self->{'y'} = 0;
     }
 
     package Point3D;
     our @ISA = ('Point');
-    
+
     Point3D->meta->add_attribute('z' => (
         default => 123
     ));
@@ -69,9 +69,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');
 
-dies_ok {
+isnt( exception {
     $point->x(42);
-} '... cannot write to a read-only accessor';
+}, undef, '... cannot write to a read-only accessor' );
 is($point->x, 2, '... the x attribute was not altered');
 
 $point->clear();
@@ -99,9 +99,11 @@ is($point3d->{'z'}, 3, '... the z attribute was initialized correctly through th
 {
     my $point3d = Point3D->new();
     isa_ok($point3d, 'Point3D');
-    
+
     is($point3d->x, undef, '... the x attribute was not initialized');
     is($point3d->y, undef, '... the y attribute was not initialized');
-    is($point3d->{'z'}, 123, '... the z attribute was initialized correctly through the metaobject');    
-        
+    is($point3d->{'z'}, 123, '... the z attribute was initialized correctly through the metaobject');
+
 }
+
+done_testing;