Browse Source

Adding nvm exec tests.

master
Jordan Harband 11 years ago
parent
commit
1fa2acf5a7
  1. 13
      test/slow/nvm exec/Running "nvm exec 0.x" should work
  2. 17
      test/slow/nvm exec/Running "nvm exec" should pick up .nvmrc version
  3. 10
      test/slow/nvm exec/setup_dir
  4. 12
      test/slow/nvm exec/teardown_dir

13
test/slow/nvm exec/Running "nvm exec 0.x" should work

@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
#!/bin/sh
die () { echo $@ ; exit 1; }
. ../../../nvm.sh
nvm use 0.10
NPM_VERSION_TEN="$(npm --version)"
nvm use 0.11.7 && [ "$(node --version)" = "v0.11.7" ] || die "\`nvm use\` failed!"
[ "$(nvm exec 0.10 npm --version | tail -1)" = "$NPM_VERSION_TEN" ] || die "`nvm exec` failed to run with the correct version"

17
test/slow/nvm exec/Running "nvm exec" should pick up .nvmrc version

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
#!/bin/sh
die () { echo $@ ; exit 1; }
. ../../../nvm.sh
nvm use 0.10.7
NPM_VERSION_TEN="$(npm --version)"
nvm use 0.11.7 && [ "$(node --version)" = "v0.11.7" ] || die "\`nvm use\` failed!"
echo "0.10.7" > .nvmrc
[ "$(nvm exec npm --version | tail -1)" = "$NPM_VERSION_TEN" ] || die "\`nvm exec\` failed to run with the .nvmrc version"
[ "$(nvm exec npm --version | head -1)" = "Found '$PWD/.nvmrc' with version <0.10.7>" ] || die "\`nvm exec\` failed to print out the \"found in .nvmrc\" message"

10
test/slow/nvm exec/setup_dir

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
#!/bin/sh
. ../../../nvm.sh
nvm install 0.10.7
nvm install 0.11.7
if [ -f ".nvmrc" ]; then
mv .nvmrc .nvmrc.bak
fi

12
test/slow/nvm exec/teardown_dir

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
#!/bin/sh
. ../../../nvm.sh
nvm uninstall v0.10.7
nvm uninstall v0.11.7
rm .nvmrc
if [ -f ".nvmrc.bak" ]; then
mv .nvmrc.bak .nvmrc
fi
Loading…
Cancel
Save