From 58a3f75d052e05f6c2238d036f12ff0678362d7a Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Mon, 9 Jun 2014 22:39:30 -0400 Subject: [PATCH] run-spec will now set wd to spec dir This removes sourcing complications --- src/run-spec | 4 +++- test/test-spec | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/run-spec b/src/run-spec index 87a9c70..a21ac51 100755 --- a/src/run-spec +++ b/src/run-spec @@ -24,6 +24,8 @@ source spec declare -r tcase="${1?Missing test case path}" _begin-spec - source "$tcase" || exit $? + cd "$( dirname "$tcase" )" \ + && source "$tcase" \ + || exit $? _end-spec diff --git a/test/test-spec b/test/test-spec index b1de373..6df9350 100644 --- a/test/test-spec +++ b/test/test-spec @@ -34,7 +34,7 @@ # This will take an arbitrary script from stdin and execute it test-run() { - ../src/run-spec <( cat ) + ( cd ../src && ./run-spec <( cat ) ) }