1 use Test::More tests => 4;
2 use Test::MooseX::Daemonize;
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);
15 has filename => ( isa => 'Str', is => 'ro' );
19 $self->create_file( $self->filename )
24 my ( $self, $file ) = @_;
25 open( my $FILE, ">$file" ) || die $!;
37 ## Try to make sure we are in the test directory
38 chdir 't' if ( Cwd::cwd() !~ m|/t$| );
41 my $app = FileMaker->new(
43 filename => "$cwd/im_alive",
45 daemonize_ok( $app, 'child forked okay' );
46 ok( -e $app->filename, "file exists" );
47 ok( $app->stop( no_exit => 1 ), 'app stopped' );
48 ok( not(-e $app->pidfile) , 'pidfile gone' );
49 unlink( $app->filename );