diff --git a/test/fast/Running 'nvm-exec' should display required node version b/test/fast/Running 'nvm-exec' should display required node version index 2c316fd..1aef91b 100755 --- a/test/fast/Running 'nvm-exec' should display required node version +++ b/test/fast/Running 'nvm-exec' should display required node version @@ -4,7 +4,9 @@ set -x : nvm.sh \. ../../nvm.sh -die () { echo "$@" ; rm .nvmrc ; exit 1; } +cleanup() { rm -f .nvmrc; } + +die () { echo "$@" ; cleanup ; exit 1; } NVM_TEST_VERSION=v0.42 @@ -19,3 +21,5 @@ No NODE_VERSION provided; no .nvmrc file found"; # Skip install, we want to test the error message [ "${EXPECTED}" = "${OUTPUT}" ] || die "expected >${EXPECTED}<, got >${OUTPUT}<" + +cleanup