Skip to content

Commit

Permalink
use IO::CaptureOutput due to RT#59327
Browse files Browse the repository at this point in the history
  • Loading branch information
chorny committed Jul 13, 2010
1 parent 34ed53a commit 400ca3a
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions t/lib/Perl6/Say/Auxiliary.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ use Carp;
*is = *Test::More::is;

our $capture_fail_message;
eval qq{ require IO::Capture::Stdout1; };
$capture_fail_message="tests require IO::Capture::Stdout" if $@;
eval qq{ require IO::CaptureOutput; };
$capture_fail_message="tests require IO::CaptureOutput" if $@;

sub _validate {
my $pred = shift;
Expand All @@ -36,11 +36,14 @@ sub capture_say {
}
my $pred = $argsref->{pred};
my $l = _validate($pred);
my $capture = IO::Capture::Stdout->new();
$capture->start;
&{$argsref->{eval}};
$capture->stop;
my $cat = join q{}, $capture->read();
my $cat;
#IO::CaptureOutput->import('capture');
IO::CaptureOutput::capture(sub { &{$argsref->{eval}}; },\$cat);
#my $capture = IO::Capture::Stdout->new();
#$capture->start;
#&{$argsref->{eval}};
#$capture->stop;
#my $cat = join q{}, $capture->read();
unless ($str) {
$str = join q{}, @list;
}
Expand Down

0 comments on commit 400ca3a

Please sign in to comment.