X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F02.stdout.t;h=d7ed21222b649e07e247cfbe14fd408bf68e9629;hb=380acf654017b03f0ea0342bca243c509904f1bb;hp=f76a392e49b97ffbfbf24c443a3053183e68c31e;hpb=b916501e3239371f7c4b70e9657ccb97c8ff7c03;p=gitmo%2FMooseX-Daemonize.git diff --git a/t/02.stdout.t b/t/02.stdout.t index f76a392..d7ed212 100644 --- a/t/02.stdout.t +++ b/t/02.stdout.t @@ -14,7 +14,8 @@ my $Test = Test::Builder->new; after start => sub { my ($self) = @_; - $self->output_ok(); + $self->output_ok() + if $self->is_daemon; }; sub output_ok { @@ -29,16 +30,18 @@ my $Test = Test::Builder->new; } package main; -use Cwd; use strict; use warnings; +use File::Spec::Functions; +use File::Temp qw(tempdir); + +my $dir = tempdir( CLEANUP => 1 ); + ## Try to make sure we are in the test directory -chdir 't' if ( Cwd::cwd() !~ m|/t$| ); -my $cwd = Cwd::cwd(); my $app = TestOutput->new( - pidbase => $cwd, - test_output => join( '/', $cwd, 'results' ), + pidbase => $dir, + test_output => catfile($dir, 'results'), ); daemonize_ok( $app, 'child forked okay' ); sleep(3); # give ourself a chance to produce some output