convert all uses of Test::Exception to Test::Fatal.
[gitmo/Moose.git] / t / 040_type_constraints / 005_util_type_coercion.t
index 86a158c..c60cf5b 100644 (file)
@@ -3,11 +3,11 @@
 use strict;
 use warnings;
 
-use Test::More tests => 26;
-use Test::Exception;
+use Test::More;
+use Test::Fatal;
 
 BEGIN {
-       use_ok('Moose::Util::TypeConstraints');
+    use_ok('Moose::Util::TypeConstraints');
 }
 
 {
@@ -40,13 +40,13 @@ ok(!Header({}), '... this did not pass the type test');
 
 my $anon_type = subtype Object => where { $_->isa('HTTPHeader') };
 
-lives_ok {
+ok ! exception {
     coerce $anon_type
         => from ArrayRef
             => via { HTTPHeader->new(array => $_[0]) }
         => from HashRef
             => via { HTTPHeader->new(hash => $_[0]) };
-} 'coercion of anonymous subtype succeeds';
+}, 'coercion of anonymous subtype succeeds';
 
 foreach my $coercion (
     find_type_constraint('Header')->coercion,
@@ -100,3 +100,5 @@ coerce 'StrWithTrailingX'
 my $tc = find_type_constraint('StrWithTrailingX');
 is($tc->coerce("foo"), "fooX", "coerce when needed");
 is($tc->coerce("fooX"), "fooX", "do not coerce when unneeded");
+
+done_testing;