Skip to content
Myr

Add tests for "`nvm use default` on source" behavior.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Jordan Harband · committed by Jordan Harband · parent 370dfca · Browse files · 3 files+30 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+30 added−0 removed

  • tests:+30 added−0 removed

3 files+30 added−0 removed

added:test/installation/sourcing/setup_dir+8 added
1#!/bin/sh23mkdir -p ../../../alias45. ../../../nvm.sh6nvm install 0.10.17nvm unload || echo >&2 'nvm unload failed'8
added:test/installation/sourcing/Sourcing nvm.sh should use the default if available+17 added
1#!/bin/sh23die () { echo $@ ; exit 1; }45echo '0.10.1' > ../../../alias/default || die 'creation of default alias failed'67. ../../../nvm.sh || die 'sourcing returned nonzero exit code'89NVM_LS_CURRENT="$(nvm ls current | \grep -o v0.10.1)"10[ "_$NVM_LS_CURRENT" = '_v0.10.1' ] || die "'nvm ls current' did not return '-> v0.10.1', got '$NVM_LS_CURRENT'"1112# NVM_LS_CURRENT_COLORED="$(nvm ls current | sed -n l)"1314NVM_ALIAS_DEFAULT="$(nvm alias default)"15[ "_$NVM_ALIAS_DEFAULT" = "_default -> 0.10.1 (-> v0.10.1)" ] \16 || die "'nvm alias default did not return 'default -> 0.10.1 (-> v0.10.1)', got '$NVM_ALIAS_DEFAULT'"17
added:test/installation/sourcing/teardown_dir+5 added
1#!/bin/sh23rm -rf ../../../alias4rm -rf ../../../v0.10.15