[Tests] flesh out `nvm_print_default_alias` tests

Jordan Harband 2016-04-30 00:38:49 -07:00
parent d705ec7ebf
commit 2d50606a78
No known key found for this signature in database
GPG Key ID: 64A196AEE0916D55
1 changed files with 4 additions and 0 deletions

View File

@ -13,6 +13,10 @@ nvm_print_implicit_alias() {
echo '' echo ''
} }
OUTPUT="$(nvm_print_default_alias 2>&1)"
EXPECTED_OUTPUT='A default alias is required.'
[ "$OUTPUT" = "$EXPECTED_OUTPUT" ] || die "'nvm_print_default_alias' produced wrong output; got '$OUTPUT', expected '$EXPECTED_OUTPUT'"
OUTPUT="$(nvm_print_default_alias foo | strip_colors)" OUTPUT="$(nvm_print_default_alias foo | strip_colors)"
EXPECTED_OUTPUT='' EXPECTED_OUTPUT=''
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "'nvm_print_default_alias foo' should produce no output when nvm_print_implicit_alias does not; got '$OUTPUT'" [ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "'nvm_print_default_alias foo' should produce no output when nvm_print_implicit_alias does not; got '$OUTPUT'"