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`.
master
Emanuele Aina 2013-05-03 17:46:21 +01:00
parent b2b29ff5c5
commit 8486a0da2b
1 changed files with 10 additions and 2 deletions

View File

@ -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"