From 8486a0da2b88378499e040cb9667d0ac99962cb2 Mon Sep 17 00:00:00 2001 From: Emanuele Aina Date: Fri, 3 May 2013 17:46:21 +0100 Subject: [PATCH] Fix the 'nvm deactivate' test `nvm deactivate` does not really remove the nvm command, it just remove the entries from $PATH and $MANPATH previously adde with `nvm use`. --- ...te\" should unset the nvm environment variables." | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git "a/test/fast/Running \"nvm deactivate\" should unset the nvm environment variables." "b/test/fast/Running \"nvm deactivate\" should unset the nvm environment variables." index 1dcef65..0f2ad3b 100755 --- "a/test/fast/Running \"nvm deactivate\" should unset the nvm environment variables." +++ "b/test/fast/Running \"nvm deactivate\" should unset the nvm environment variables." @@ -1,6 +1,14 @@ #!/bin/sh +mkdir -p ../../v0.2.3 + +die () { echo $@ ; exit 1; } + +[[ $PATH != *v0.2.3/*/bin* ]] || echo "WARNING: Unexpectedly found v0.2.3 already active" >&2 + . ../../nvm.sh -nvm && +nvm use v0.2.3 && +[[ $PATH == *v0.2.3/*/bin* ]] || die "Failed to activate v0.2.3" + nvm deactivate && -! nvm +[[ $PATH != *v0.2.3/*/bin* ]] || die "Failed to deactivate v0.2.3"