Redid conversion to Test::Fatal
[gitmo/Moose.git] / t / 300_immutable / 012_default_values.t
index f74a694..2b9ab02 100644 (file)
@@ -3,8 +3,8 @@
 use strict;
 use warnings;
 
-use Test::More tests => 12;
-use Test::Exception;
+use Test::More;
+use Test::Fatal;
 
 {
 
@@ -17,8 +17,7 @@ use Test::Exception;
     has 'buz' => ( is => 'rw', default => q{"'\\} );
     has 'faz' => ( is => 'rw', default => qq{\0} );
 
-    ::lives_ok {  __PACKAGE__->meta->make_immutable }
-        'no errors making a package immutable when it has default values that could break quoting';
+    ::is( ::exception {  __PACKAGE__->meta->make_immutable }, undef, 'no errors making a package immutable when it has default values that could break quoting' );
 }
 
 my $foo = Foo->new;
@@ -47,8 +46,7 @@ is( $foo->faz, qq{\0},
     has 'buz' => ( is => 'rw', default => q{"'\\}, lazy => 1 );
     has 'faz' => ( is => 'rw', default => qq{\0}, lazy => 1 );
 
-    ::lives_ok {  __PACKAGE__->meta->make_immutable }
-        'no errors making a package immutable when it has lazy default values that could break quoting';
+    ::is( ::exception {  __PACKAGE__->meta->make_immutable }, undef, 'no errors making a package immutable when it has lazy default values that could break quoting' );
 }
 
 my $bar = Bar->new;
@@ -62,3 +60,5 @@ is( $bar->buz, q{"'\\},
     'default value for buz attr' );
 is( $bar->faz, qq{\0},
     'default value for faz attr' );
+
+done_testing;