X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F01.filecreate.t;h=127c0e830a1382688a37ded84ce8e32c9c19d6c0;hb=HEAD;hp=b0af491244829e12d93f5080e1d37c3a8213826a;hpb=91e059f21638b703dd48a700b4d9207a5622dfd2;p=gitmo%2FMooseX-Daemonize.git diff --git a/t/01.filecreate.t b/t/01.filecreate.t index b0af491..127c0e8 100644 --- a/t/01.filecreate.t +++ b/t/01.filecreate.t @@ -1,5 +1,3 @@ -#!/usr/bin/perl - use strict; use warnings; use File::Spec::Functions; @@ -28,8 +26,8 @@ $ENV{MX_DAEMON_STDERR} = catfile($dir, 'Err.txt'); with qw(MooseX::Daemonize); has filename => ( isa => 'Str', is => 'ro' ); - - after start => sub { + + after start => sub { my $self = shift; if ($self->is_daemon) { $self->create_file( $self->filename ); @@ -45,7 +43,7 @@ $ENV{MX_DAEMON_STDERR} = catfile($dir, 'Err.txt'); } my $app = FileMaker->new( - pidbase => $dir, + pidbase => "$dir/subdir", filename => $FILENAME, ); isa_ok($app, 'FileMaker'); @@ -55,7 +53,7 @@ does_ok($app, 'MooseX::Daemonize::Core'); isa_ok($app->pidfile, 'MooseX::Daemonize::Pid::File'); -is($app->pidfile->file, catfile($dir, "filemaker.pid"), '... got the right PID file path'); +is($app->pidfile->file, catfile("$dir/subdir", "filemaker.pid"), '... got the right PID file path'); ok(not(-e $app->pidfile->file), '... our pidfile does not exist'); ok(!$app->status, '... the daemon is running'); @@ -84,14 +82,14 @@ is($app->exit_code, MooseX::Daemonize->OK, '... got the right error code'); if (DEBUG) { diag `ps $pid`; - diag "Status is: " . $app->status_message; + diag "Status is: " . $app->status_message; } ok( -e $app->filename, "file exists" ); if (DEBUG) { diag `ps $pid`; - diag "Status is: " . $app->status_message; + diag "Status is: " . $app->status_message; } ok( $app->stop, '... app stopped' ); @@ -104,7 +102,7 @@ is($app->exit_code, MooseX::Daemonize->ERROR, '... got the right error code'); if (DEBUG) { diag `ps $pid`; - diag "Status is: " . $app->status_message; + diag "Status is: " . $app->status_message; } ok( not(-e $app->pidfile->file) , '... pidfile gone' );