Adding a test for `nvm install invalid` behavior, and correcting the message.

From f00d688c87 (commitcomment-6205164)
master
Jordan Harband 2014-05-04 12:03:26 -07:00
parent e562a5645b
commit 673cda56c4
2 changed files with 8 additions and 1 deletions

2
nvm.sh
View File

@ -309,7 +309,7 @@ nvm() {
[ -d "$NVM_DIR/$VERSION" ] && echo "$VERSION is already installed." && return
if [ "$VERSION" = "N/A" ]; then
echo "Version '$VERSION' not found - try \`nvm ls-remote\` to browse available versions."
echo "Version '$provided_version' not found - try \`nvm ls-remote\` to browse available versions."
return 3
fi

View File

@ -0,0 +1,7 @@
#!/bin/sh
die () { echo $@ ; exit 1; }
. ../../nvm.sh
[ "$(nvm install invalid.invalid)" = "Version 'invalid.invalid' not found - try \`nvm ls-remote\` to browse available versions." ] || die "nvm installing an invalid version did not print a nice error message"