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.
This commit is contained in:
Travis Swicegood
2016-03-25 17:46:46 -05:00
parent ae179df0c2
commit 3eb35f6054

View File

@@ -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}