From 3eb35f6054146d2a0300648ba0d21043b41a43f9 Mon Sep 17 00:00:00 2001 From: Travis Swicegood Date: Fri, 25 Mar 2016 17:46:46 -0500 Subject: [PATCH] Fix issue with PATH causing test failures I was seeing an issue where modifying PATH caused the Ruby plugin tests to fail. I fixed that and while digging around fixed an issue that would cause the tests to behave weirdly if run from any other location. This solves one of the issues noted in #687, but I haven't tried running the new tests from that PR with these changes. --- test/run | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/run b/test/run index 2efc35d0..f626521d 100755 --- a/test/run +++ b/test/run @@ -1,6 +1,5 @@ #!/usr/bin/env bash -PATH=$PATH:$(pwd)/bats/bin -set +e -[[ -z "$(which bats)" ]] && git clone --depth 1 https://github.com/sstephenson/bats.git -set -e -exec bats ${CI:+--tap} test/{lib,plugins} +_TEST_DIR="$(cd "$(dirname "$0")" && pwd)" +_BATS="${_TEST_DIR}/../bats/bin/bats" +[ ! -e $_BATS ] && git clone --depth 1 https://github.com/sstephenson/bats.git ${_TEST_DIR}/../bats +exec $_BATS ${CI:+--tap} ${_TEST_DIR}/{lib,plugins}