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' );
16 after start => sub { $_[0]->create_file( $_[0]->filename ) };
19 my ( $self, $file ) = @_;
20 open( my $FILE, ">$file" ) || die $!;
30 ## Try to make sure we are in the test directory
31 chdir 't' if ( Cwd::cwd() !~ m|/t$| );
34 my $app = FileMaker->new(
36 filename => "$cwd/im_alive",
38 daemonize_ok( $app, 'child forked okay' );
39 ok( -e $app->filename, "$file exists" );
40 ok( $app->stop( no_exit => 1 ), 'app stopped' );
41 ok( -e $app->pidfile == undef, 'pidfile gone' );
42 unlink( $app->filename );