2015-04-06 07:49:29 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2016-05-09 08:10:02 +08:00
|
|
|
. ../../common.sh
|
|
|
|
|
2015-04-06 07:49:29 +08:00
|
|
|
die () { echo $@ ; exit 1; }
|
|
|
|
|
|
|
|
. ../../../nvm.sh
|
|
|
|
|
|
|
|
EXPECTED_OUTPUT="nvm_ensure_default_set: a version is required"
|
|
|
|
OUTPUT="$(nvm_ensure_default_set 2>&1 >/dev/null)"
|
|
|
|
EXIT_CODE="$?"
|
2016-05-09 08:10:02 +08:00
|
|
|
[ "_$(echo "$OUTPUT" | strip_colors)" = "_$EXPECTED_OUTPUT" ] || die "'nvm_ensure_default_set' did not output "$EXPECTED_OUTPUT", got "$OUTPUT""
|
2015-04-06 07:49:29 +08:00
|
|
|
[ "_$EXIT_CODE" = "_1" ] || die "'nvm_ensure_default_set' did not exit with 1, got "$EXIT_CODE""
|
|
|
|
|
|
|
|
# see test/fast/Aliases for remaining nvm_ensure_default_set tests
|