1 use Test::More no_plan => 1;
5 ## Since a daemon will not be able to print terminal output, we
6 ## have a test daemon create a file, and another process test for
13 with qw(MooseX::Daemonize);
16 my ( $self, $file ) = @_;
17 open( FILE, ">$file" ) || die $!;
26 ## Try to make sure we are in the test directory
28 chdir 't' if ( $cwd !~ m|/t$| );
32 my $file = join( '/', $cwd, 'im_alive' );
33 ## Parent process will check if file created. Child becomes the daemon.
34 if ( my $pid = Proc::Daemon::Fork ) {
35 sleep(5); # Punt on sleep time, 5 seconds should be enough
36 ok( -e $file, "$file exists");
40 my $daemon = FileMaker->new(pidbase => '.');
42 $daemon->create_file($file);