Subject: | run.t failure when command "foo" exists in installer's shell's search path |
t/run.t fails if the user installing Module::Release just happens to
have a command named "foo" in their shell's search path. The test
should specify a directory path on the command which is guaranteed to
make the test fail, ie "./foo".
Patch attached.
Subject: | 0001-Fix-run.t-test-that-unexpectedly-finds-a-command-fo.patch |
From be952b49f94597ee6ff82b0d8e6fd4658a8a80de Mon Sep 17 00:00:00 2001
From: root <root@falcon.localdomain>
Date: Thu, 5 Feb 2009 19:36:15 -0600
Subject: [PATCH] Fix run.t test that unexpectedly finds a command 'foo'.
run.t attempts to provide a run() failure using a command 'foo'
which is presumed to not exist. Unfortunately, I happened to have
such a command in ~/bin, and because the command string provided
does not specify a directory path, the shell found the command in
my path and ran it, causing the test to fail.
This patch changes the test command from 'foo' to './foo', which is
going to look for 'foo' only in the current working directory instead of
the shell's command path, and so should fail on all platforms.
---
t/run.t | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/t/run.t b/t/run.t
index 8e765a9..9c67889 100644
--- a/t/run.t
+++ b/t/run.t
@@ -58,7 +58,7 @@ like( $at, qr/Didn't get a command!/, "Error message with undef argument" );
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Pass it a bad command
{
-my $command = "foo";
+my $command = "./foo";
ok( ! -x $command, "$command is not executable (good)" );
my $message = eval { $release->run( qq|$command| ) };
--
1.6.0.3