convert uses of Test::Exception to Test::Fatal
Karen Etheridge [Mon, 15 Apr 2013 00:43:45 +0000 (17:43 -0700)]
Makefile.PL
t/10.pidfile.t
t/20.core.t
t/21.core-back-compat.t
t/30.with_pid_file.t

index cd8edc0..4495486 100644 (file)
@@ -13,7 +13,7 @@ requires 'Moose'                      => 0.33;
 requires 'MooseX::Getopt'             => 0.07;
 requires 'MooseX::Types::Path::Class' => 0;
 requires 'File::Path'                 => 2.08;
-test_requires 'Test::Exception'       => 0;
+test_requires 'Test::Fatal'           => 0;
 
 no_index 'directory' => 'examples';
 
index a5a06c0..66aa30f 100644 (file)
@@ -4,7 +4,7 @@ use strict;
 use warnings;
 
 use Test::More tests => 25;
-use Test::Exception;
+use Test::Fatal;
 
 BEGIN {
     use_ok('MooseX::Daemonize::Pid::File');
@@ -20,17 +20,21 @@ BEGIN {
 
     is($f->pid, $$, '... the PID is our current process');
 
-    lives_ok {
-        $f->write
-    } '... writing the PID file';
+    is(
+        exception { $f->write },
+        undef,
+        '... writing the PID file',
+    );
 
     is($f->file->slurp(chomp => 1), $f->pid, '... the PID in the file is correct');
     
     ok($f->is_running, '... it is running too');
 
-    lives_ok {
-        $f->remove
-    } '... removing the PID file';
+    is(
+        exception { $f->remove },
+        undef,
+        '... removing the PID file',
+    );
 
     ok(!-e $f->file, '... the PID file does not exist anymore');
 }
@@ -43,18 +47,22 @@ BEGIN {
 
     isa_ok($f->file, 'Path::Class::File');
 
-    lives_ok {
-        $f->write
-    } '... writing the PID file';
+    is(
+        exception { $f->write },
+        undef,
+        '... writing the PID file',
+    );
 
     is($f->file->slurp(chomp => 1), $f->pid, '... the PID in the file is correct');
     is($f->pid, $$, '... the PID is our current process');
     
     ok($f->is_running, '... it is running too');    
 
-    lives_ok {
-        $f->remove
-    } '... removing the PID file';
+    is(
+        exception { $f->remove },
+        undef,
+        '... removing the PID file',
+    );
 
     ok(!-e $f->file, '... the PID file does not exist anymore');
 }
@@ -72,17 +80,21 @@ BEGIN {
     
     is($f->pid, $PID, '... the PID is our made up PID');
 
-    lives_ok {
-        $f->write
-    } '... writing the PID file';
+    is(
+        exception { $f->write },
+        undef,
+        '... writing the PID file',
+    );
 
     is($f->file->slurp(chomp => 1), $f->pid, '... the PID in the file is correct');
 
     ok(!$f->is_running, '... it is not running (cause we made the PID up)');
 
-    lives_ok {
-        $f->remove
-    } '... removing the PID file';
+    is(
+        exception { $f->remove },
+        undef,
+        '... removing the PID file',
+    );
 
     ok(!-e $f->file, '... the PID file does not exist anymore');
 }
index e239e80..a4c5f33 100644 (file)
@@ -4,7 +4,7 @@ use strict;
 use warnings;
 
 use Test::More 'no_plan';
-use Test::Exception;
+use Test::Fatal;
 use Test::Moose;
 use File::Temp qw(tempdir);
 use File::Spec::Functions;
@@ -68,9 +68,11 @@ my $d = MyFooDaemon->new;
 isa_ok($d, 'MyFooDaemon');
 does_ok($d, 'MooseX::Daemonize::Core');
 
-lives_ok {
-    $d->start;
-} '... successfully daemonized from (' . $$ . ')';
+is(
+    exception { $d->start },
+    undef,
+    '... successfully daemonized from (' . $$ . ')',
+);
 
 my $p = $d->daemon_pid;
 isa_ok($p, 'MooseX::Daemonize::Pid');
index d0cd59c..cf5ce00 100644 (file)
@@ -4,7 +4,7 @@ use strict;
 use warnings;
 
 use Test::More 'no_plan';
-use Test::Exception;
+use Test::Fatal;
 use Test::Moose;
 use File::Temp qw(tempdir);
 use File::Spec::Functions;
@@ -69,9 +69,11 @@ my $d = MyFooDaemon->new;
 isa_ok($d, 'MyFooDaemon');
 does_ok($d, 'MooseX::Daemonize::Core');
 
-lives_ok {
-    $d->start;
-} '... successfully daemonized from (' . $$ . ')';
+is(
+    exception { $d->start },
+    undef,
+    '... successfully daemonized from (' . $$ . ')',
+);
 
 my $p = $d->daemon_pid;
 isa_ok($p, 'MooseX::Daemonize::Pid');
index e7e439c..8536c81 100644 (file)
@@ -6,7 +6,7 @@ use warnings;
 use File::Spec::Functions;
 
 use Test::More 'no_plan';
-use Test::Exception;
+use Test::Fatal;
 use Test::Moose;
 use File::Temp qw(tempdir);
 
@@ -73,9 +73,11 @@ ok($d->has_pidfile, '... we have a pidfile value');
 
 ok(!(-e $PIDFILE), '... the PID file does not exist yet');
 
-lives_ok {
-    $d->start;
-} '... successfully daemonized from (' . $$ . ')';
+is(
+    exception { $d->start },
+    undef,
+    '... successfully daemonized from (' . $$ . ')',
+);
 
 my $p = $d->pidfile;
 isa_ok($p, 'MooseX::Daemonize::Pid::File');