changing all versions to 0.15
[gitmo/MooseX-Daemonize.git] / lib / Test / MooseX / Daemonize.pm
index ec42672..30abc9f 100644 (file)
@@ -1,12 +1,13 @@
 package Test::MooseX::Daemonize;
 use strict;
 
+our $VERSION   = '0.15';
+our $AUTHORITY = 'cpan:PERIGRIN';
+
 # BEGIN CARGO CULTING
 use Sub::Exporter;
 use Test::Builder;
 
-our $VERSION   = '0.03';
-our $AUTHORITY = 'cpan:PERIGRIN';
 
 {
     my @exports = qw[
@@ -103,25 +104,24 @@ Test::MooseX::Daemonize - Tool to help test MooseX::Daemonize applications
 This document describes MooseX::Daemonize version 0.0.1
 
 =head1 SYNOPSIS
-    
-    package main;
-    use Cwd;
+
+    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 $file = join( '/', $cwd, 'im_alive' );
-    my $daemon = FileMaker->new( pidbase => '.', filename => $file );
+    my $file = catfile( $dir, "im_alive" );
+    my $daemon = FileMaker->new( pidbase => $dir, filename => $file );
 
     daemonize_ok( $daemon, 'child forked okay' );
     ok( -e $file, "$file exists" );
-    unlink($file);
 
 =head1 DESCRIPTION
 
-This module provides some basic Test::Builder compatible test methods to 
-use when writing tests for you MooseX::Daemonize based modules. 
+This module provides some basic Test::Builder compatible test methods to
+use when writing tests for you MooseX::Daemonize based modules.
 
 =head1 EXPORTED FUNCTIONS
 
@@ -129,16 +129,16 @@ use when writing tests for you MooseX::Daemonize based modules.
 
 =item B<daemonize_ok ( $daemon, ?$msg )>
 
-This will attempt to daemonize your C<$daemon> returning ok on 
+This will attempt to daemonize your C<$daemon> returning ok on
 success and not ok on failure.
 
 =item B<check_test_output ( $daemon )>
 
-This is expected to be used with a C<$daemon> which does the 
+This is expected to be used with a C<$daemon> which does the
 B<Test::MooseX::Daemonize::Testable> role (included in this package
-see the source for more info). It will collect the test output 
-from your daemon and apply it in the parent process by mucking 
-around with L<Test::Builder> stuff, again, read the source for 
+see the source for more info). It will collect the test output
+from your daemon and apply it in the parent process by mucking
+around with L<Test::Builder> stuff, again, read the source for
 more info. If we get time we will document this more thoroughly.
 
 =back
@@ -165,7 +165,7 @@ Chris Prather  C<< <perigrin@cpan.org> >>
 
 =head1 LICENCE AND COPYRIGHT
 
-Copyright (c) 2007-2008, Chris Prather C<< <perigrin@cpan.org> >>. All rights reserved.
+Copyright (c) 2007-2011, Chris Prather C<< <perigrin@cpan.org> >>. All rights reserved.
 
 This module is free software; you can redistribute it and/or
 modify it under the same terms as Perl itself. See L<perlartistic>.