1
0
mirror of https://github.com/sstephenson/bats.git synced 2024-12-26 06:29:47 +01:00
This commit is contained in:
Sam Stephenson 2014-06-01 18:04:29 -05:00
parent 6b4802cf54
commit c7b0e6eba8

View File

@ -30,14 +30,15 @@ BATS_TEST_DIRNAME="$(dirname "$BATS_TEST_FILENAME")"
BATS_TEST_NAMES=() BATS_TEST_NAMES=()
load() { load() {
local inc="$1" local name="$1"
local filename local filename
if [[ "${inc}" == "/"* ]] ; then if [ "${name:0:1}" = "/" ]; then
filename="${inc}" filename="${name}"
else else
filename="$BATS_TEST_DIRNAME/${inc}.bash" filename="$BATS_TEST_DIRNAME/${name}.bash"
fi fi
[ -f "$filename" ] || { [ -f "$filename" ] || {
echo "bats: $filename does not exist" >&2 echo "bats: $filename does not exist" >&2
exit 1 exit 1