X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FTest%2FMooseX%2FDaemonize.pm;h=dbccc4479176c6c82df022040939635d3f9f4c9b;hb=d5a304d98a6c9092181f55e00551591aeba03406;hp=4dd29ff1344b3ab434dfb5235688ad20671c10f1;hpb=2ecc2ccba1b854569f9b5792a72489afec1d17aa;p=gitmo%2FMooseX-Daemonize.git diff --git a/lib/Test/MooseX/Daemonize.pm b/lib/Test/MooseX/Daemonize.pm index 4dd29ff..dbccc44 100644 --- a/lib/Test/MooseX/Daemonize.pm +++ b/lib/Test/MooseX/Daemonize.pm @@ -1,27 +1,16 @@ -package Test::MooseX::Daemonize; use strict; - -our $VERSION = '0.11'; -our $AUTHORITY = 'cpan:PERIGRIN'; +use warnings; +package Test::MooseX::Daemonize; # BEGIN CARGO CULTING -use Sub::Exporter; -use Test::Builder; - - -{ - my @exports = qw[ - daemonize_ok - check_test_output - ]; +use Sub::Exporter::ForMethods 'method_installer'; +use Sub::Exporter -setup => { + exports => [ qw(daemonize_ok check_test_output) ], + groups => { default => [ qw(daemonize_ok check_test_output) ] }, + installer => method_installer, +}; - Sub::Exporter::setup_exporter( - { - exports => \@exports, - groups => { default => \@exports } - } - ); -} +use Test::Builder; our $Test = Test::Builder->new; @@ -52,20 +41,22 @@ sub check_test_output { # We don't just call ok(!$not), because that generates diagnostics of # its own for failures. We only want the diagnostics from the child. - my $num = $Test->current_test; - $Test->current_test( ++$num ); - $Test->_print("$status $num - $text\n"); + my $orig_no_diag = $Test->no_diag; + $Test->no_diag(1); + $Test->ok(!$not, $text); + $Test->no_diag($orig_no_diag); } elsif ( $line =~ s/\A#\s?// ) { $Test->diag($line); } else { - $Test->_print_diag("$label: $line (unrecognised)\n"); + $Test->diag("$label: $line (unrecognised)\n"); } } } package Test::MooseX::Daemonize::Testable; + use Moose::Role; has test_output => ( @@ -99,10 +90,6 @@ __END__ Test::MooseX::Daemonize - Tool to help test MooseX::Daemonize applications -=head1 VERSION - -This document describes MooseX::Daemonize version 0.0.1 - =head1 SYNOPSIS use File::Spec::Functions; @@ -165,7 +152,7 @@ Chris Prather C<< >> =head1 LICENCE AND COPYRIGHT -Copyright (c) 2007-2010, Chris Prather C<< >>. All rights reserved. +Copyright (c) 2007-2011, Chris Prather C<< >>. 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.