1
0
mirror of https://github.com/sstephenson/bats.git synced 2024-12-25 22:19:44 +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=()
load() {
local inc="$1"
local name="$1"
local filename
if [[ "${inc}" == "/"* ]] ; then
filename="${inc}"
if [ "${name:0:1}" = "/" ]; then
filename="${name}"
else
filename="$BATS_TEST_DIRNAME/${inc}.bash"
filename="$BATS_TEST_DIRNAME/${name}.bash"
fi
[ -f "$filename" ] || {
echo "bats: $filename does not exist" >&2
exit 1