use warnings;
use Test::More tests => 25;
-use Test::Exception;
+use Test::Fatal;
BEGIN {
use_ok('MooseX::Daemonize::Pid::File');
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');
}
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');
}
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');
}
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;
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');
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;
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');
use File::Spec::Functions;
use Test::More 'no_plan';
-use Test::Exception;
+use Test::Fatal;
use Test::Moose;
use File::Temp qw(tempdir);
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');