summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-01-02 10:17:51 -0600
committerJesse Luehrs <doy@tozt.net>2013-01-02 10:17:51 -0600
commit1a78464c29f3a79dad22222ac7b8522a82d099c4 (patch)
treeb17c7063b0fccf18b63d68dbaa77e78ce982c37f
parentb12e88e8bb8961726e781e6edf1c0fcf2f26c682 (diff)
downloadcarp-always-color-1a78464c29f3a79dad22222ac7b8522a82d099c4.tar.gz
carp-always-color-1a78464c29f3a79dad22222ac7b8522a82d099c4.zip
make this test work with prove
it previously only worked under 'make test', which sets up @INC properly
-rw-r--r--t/detect.t3
1 files changed, 3 insertions, 0 deletions
diff --git a/t/detect.t b/t/detect.t
index 772365c..158ce31 100644
--- a/t/detect.t
+++ b/t/detect.t
@@ -6,11 +6,14 @@ BEGIN {
eval "use IO::Pty::Easy;";
plan skip_all => "IO::Pty::Easy is required for this test" if $@;
}
+use B;
sub output_like {
local $Test::Builder::Level = $Test::Builder::Level + 1;
my ($script, $expected, $desc) = @_;
my $pty = IO::Pty::Easy->new;
+ my $inc = '(' . join(',', map { B::perlstring($_) } @INC) . ')';
+ $script = "BEGIN { \@INC = $inc }$script";
$pty->spawn("$^X", "-e", $script);
like($pty->read, $expected, $desc);
}