converted to Test::Fatal
Todd Hepler [Tue, 27 Mar 2012 17:50:51 +0000 (12:50 -0500)]
dist.ini
t/04.existing.t

index f3399de..f7a3e5e 100644 (file)
--- a/dist.ini
+++ b/dist.ini
@@ -17,10 +17,9 @@ Moose = 0.39
 MooseX::Types = 0.04
 Path::Class = 0.16
 
-;TODO: move to Test::Fatal
 [Prereqs / TestRequires]
 Test::More = 0.88
-Test::Exception = 0.27
+Test::Fatal = 0
 
 [PodSyntaxTests]
 [PodCoverageTests]
index 5d8f63e..0095413 100644 (file)
@@ -23,7 +23,7 @@ package main;
 use strict;
 use warnings;
 use Test::More;
-use Test::Exception;
+use Test::Fatal;
 
 my $no_exist = '/should/not/exist';
 
@@ -39,10 +39,16 @@ ok is_ExistingFile(to_ExistingFile("/etc/passwd")), '/etc/passwd is an existing
 
 ok is_ExistingDir(to_ExistingDir("/etc/")), '/etc/ is an existing directory';
 
-throws_ok { Bar->new( dir => $no_exist ); }
-    qr/Directory .* must exist/, 'no exist dir throws';
-throws_ok { Bar->new( file => "$no_exist/either" ); }
-    qr/File .* must exist/, 'no exist file throws';
+like(
+    exception { Bar->new(dir  => $no_exist); },
+    qr/Directory .* must exist/,
+    'no exist dir throws',
+);
+like(
+    exception { Bar->new(file => "$no_exist/either"); },
+    qr/File .* must exist/,
+    'no exist file throws',
+);
 
 done_testing;