[Tests] `nvm_command_info`: make error output more helpful

Jordan Harband 2019-02-25 13:17:10 -08:00
parent 226487d358
commit 9daf26f0a0
No known key found for this signature in database
GPG Key ID: 64A196AEE0916D55
1 changed files with 8 additions and 4 deletions

View File

@ -46,9 +46,13 @@ WGET_EXPECTED_INFO="$(type wget)"
cleanup cleanup
# 4. nvm_command_info() should not have standard error # 4. nvm_command_info() should not have standard error
nvm_command_info ls 2>&1 >/dev/null | grep . && die "\`nvm_command_info ls\` should not return standard error message(stage 4)" OUTPUT="$(nvm_command_info ls 2>&1 >/dev/null)"
nvm_command_info rm 2>&1 >/dev/null | grep . && die "\`nvm_command_info rm\` should not return standard error message(stage 4)" [ -z "${OUTPUT}" ] || die "\`nvm_command_info ls\` expected no stderr; got >${OUTPUT}< (stage 4)"
nvm_command_info git 2>&1 >/dev/null | grep . && die "\`nvm_command_info git\` should not return standard error message(stage 4)" OUTPUT="$(nvm_command_info rm 2>&1 >/dev/null)"
nvm_command_info grep 2>&1 >/dev/null | grep . && die "\`nvm_command_info grep\` should not return standard error message(stage 4)" [ -z "${OUTPUT}" ] || die "\`nvm_command_info rm\` expected no stderr; got >${OUTPUT}< (stage 4)"
OUTPUT="$(nvm_command_info git 2>&1 >/dev/null)"
[ -z "${OUTPUT}" ] || die "\`nvm_command_info git\` expected no stderr; got >${OUTPUT}< (stage 4)"
OUTPUT="$(nvm_command_info grep 2>&1 >/dev/null)"
[ -z "${OUTPUT}" ] || die "\`nvm_command_info grep\` expected no stderr; got >${OUTPUT}< (stage 4)"
cleanup cleanup