1 use Test::More tests => 2;
2 use Test::MooseX::Daemonize;
4 ## Since a daemon will not be able to print terminal output, we
5 ## have a test daemon create a file, and another process test for
12 with qw(MooseX::Daemonize);
14 has filename => ( isa => 'Str', is => 'ro' );
16 after start => sub { $_[0]->create_file( $_[0]->filename ) };
19 my ( $self, $file ) = @_;
20 open( FILE, ">$file" ) || die $!;
31 ## Try to make sure we are in the test directory
32 chdir 't' if ( Cwd::cwd() !~ m|/t$| );
35 my $file = join( '/', $cwd, 'im_alive' );
36 my $daemon = FileMaker->new( pidbase => '.', filename => $file );
38 daemonize_ok( $daemon, 'child forked okay' );
39 ok( -e $file, "$file exists" );