Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Rewrite tests not to depend on Capture::Tiny

  • Loading branch information...
commit 0feec66f79b16bd4033412b814874d911fafbd60 1 parent c7d22bb
@Leont authored
Showing with 11 additions and 2 deletions.
  1. +1 −0  Changes
  2. +10 −2 t/10-basics.t
View
1  Changes
@@ -2,6 +2,7 @@ Revision history for Devel-FindPerl
{{$NEXT}}
Soften dependency on ExtUtils::Config
+ Rewrite tests not to depend on Capture::Tiny
0.006 2012-10-21 15:32:06 Europe/Amsterdam
Cache the results of find_perl_interpreter
View
12 t/10-basics.t
@@ -5,12 +5,20 @@ use warnings;
use Test::More;
-use Capture::Tiny 'capture';
use Config;
+use IPC::Open2 'open2';
use Devel::FindPerl 'find_perl_interpreter';
my $perl = find_perl_interpreter;
-is(capture { system $perl, qw(-MConfig=myconfig -e print -e myconfig) }, Config->myconfig, 'Config of found perl equals current perl');
+is(-s $perl, -s $Config{perlpath}, 'Found perl is same-sized as expected perl');
+
+diag("$perl is not $Config{perlpath}, this may or may not be problematic") if $perl ne $Config{perlpath};
+
+my $pid = open2(my($in, $out), $perl, qw/-MConfig=myconfig -e print -e myconfig/) or die "Could not start perl at $perl";
+binmode $in, ':crlf' if $^O eq 'MSWin32';
+my $ret = do { local $/; <$in> };
+waitpid $pid, 0;
+is($ret, Config->myconfig, 'Config of found perl equals current perl');
done_testing;
Please sign in to comment.
Something went wrong with that request. Please try again.