Updates tests for the new output messages

Quildreen Motta 2016-07-05 21:40:45 -03:00
parent 0f26656c2c
commit 730b253174
2 changed files with 15 additions and 4 deletions

View File

@ -11,7 +11,9 @@ mkdir -p "$(nvm_version_path v0.1.2)"
OUTPUT="$(nvm_ensure_version_installed foo 2>&1)"
EXIT_CODE=$?
EXPECTED_OUTPUT='N/A: version "foo" is not yet installed'
EXPECTED_OUTPUT='N/A: version "foo" is not yet installed.
You need to run "nvm install foo" to install it before using it.'
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "expected 'nvm_ensure_version_installed foo' to give $EXPECTED_OUTPUT, got $OUTPUT"
[ "_$EXIT_CODE" = "_1" ] || die "expected 'nvm_ensure_version_installed foo' to exit with 1, got $EXIT_CODE"
@ -23,7 +25,9 @@ EXIT_CODE=$?
# Special case for "iojs"
OUTPUT="$(nvm_ensure_version_installed iojs 2>&1)"
EXIT_CODE=$?
EXPECTED_OUTPUT='N/A: version "iojs" is not yet installed'
EXPECTED_OUTPUT='N/A: version "iojs" is not yet installed.
You need to run "nvm install iojs" to install it before using it.'
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "expected 'nvm_ensure_version_installed iojs' to give $EXPECTED_OUTPUT, got $OUTPUT"
[ "_$EXIT_CODE" = "_1" ] || die "expected 'nvm_ensure_version_installed iojs' to exit with 1, got $EXIT_CODE"

View File

@ -5,5 +5,12 @@ die () { echo $@ ; exit 1; }
. ../../../nvm.sh
[ "$(nvm run 0.2 --version 2>&1)" = 'N/A: version "v0.2" is not yet installed' ] || die "\`nvm run\` with an uninstalled node version failed to error out correctly"
[ "$(nvm run iojs-0.2 --version 2>&1)" = 'N/A: version "iojs-v0.2" is not yet installed' ] || die "\`nvm run\` with an uninstalled iojs version failed to error out correctly"
EXPECTED_OUTPUT='N/A: version "v0.2" is not yet installed.
You need to run "nvm install 0.2" to install it before using it.'
[ "_$(nvm run 0.2 --version 2>&1)" = "_$EXPECTED_OUTPUT" ] || die "\`nvm run\` with an uninstalled node version failed to error out correctly"
EXPECTED_OUTPUT='N/A: version "iojs-v0.2" is not yet installed.
You need to run "nvm install iojs-0.2" to install it before using it.'
[ "_$(nvm run iojs-0.2 --version 2>&1)" = "_$EXPECTED_OUTPUT" ] || die "\`nvm run\` with an uninstalled iojs version failed to error out correctly"