convert to Dist::Zilla, with a minimal config
[gitmo/MooseX-Daemonize.git] / t / 01.filecreate.t
index d961841..18fecd0 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 use File::Spec::Functions;
@@ -40,11 +38,12 @@ $ENV{MX_DAEMON_STDERR} = catfile($dir, 'Err.txt');
         my ( $self, $file ) = @_;
         open( my $FILE, ">$file" ) || die $!;
         close($FILE);
+        sleep 1 while 1;
     }
 }
 
 my $app = FileMaker->new(
-    pidbase  => $dir,
+    pidbase  => "$dir/subdir",
     filename => $FILENAME,
 );
 isa_ok($app, 'FileMaker');
@@ -54,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');