Browse Source

Move sourcing tests to a separate test suite.

master
Jordan Harband 10 years ago
parent
commit
cec1c38a84
  1. 6
      .travis.yml
  2. 3
      package.json
  3. 8
      test/installation/sourcing/setup_dir
  4. 5
      test/installation/sourcing/teardown_dir
  5. 4
      test/sourcing/Sourcing nvm.sh should use the default if available
  6. 12
      test/sourcing/setup
  7. 7
      test/sourcing/teardown

6
.travis.yml

@ -19,6 +19,11 @@ env:
- SHELL=bash TEST_SUITE=slow - SHELL=bash TEST_SUITE=slow
- SHELL=zsh TEST_SUITE=slow - SHELL=zsh TEST_SUITE=slow
- SHELL=ksh TEST_SUITE=slow - SHELL=ksh TEST_SUITE=slow
- SHELL=sh TEST_SUITE=sourcing
- SHELL=dash TEST_SUITE=sourcing
- SHELL=bash TEST_SUITE=sourcing
- SHELL=zsh TEST_SUITE=sourcing
- SHELL=ksh TEST_SUITE=sourcing
- SHELL=sh TEST_SUITE=installation - SHELL=sh TEST_SUITE=installation
- SHELL=sh TEST_SUITE=installation WITHOUT_CURL=1 - SHELL=sh TEST_SUITE=installation WITHOUT_CURL=1
- SHELL=dash TEST_SUITE=installation - SHELL=dash TEST_SUITE=installation
@ -29,3 +34,4 @@ env:
- SHELL=zsh TEST_SUITE=installation WITHOUT_CURL=1 - SHELL=zsh TEST_SUITE=installation WITHOUT_CURL=1
- SHELL=ksh TEST_SUITE=installation - SHELL=ksh TEST_SUITE=installation
- SHELL=ksh TEST_SUITE=installation WITHOUT_CURL=1 - SHELL=ksh TEST_SUITE=installation WITHOUT_CURL=1

3
package.json

@ -9,7 +9,8 @@
"test": "urchin test", "test": "urchin test",
"test/fast": "urchin -f test/fast", "test/fast": "urchin -f test/fast",
"test/slow": "urchin -f test/slow", "test/slow": "urchin -f test/slow",
"test/installation": "urchin -f test/installation" "test/installation": "urchin -f test/installation",
"test/sourcing": "urchin -f test/sourcing"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

8
test/installation/sourcing/setup_dir

@ -1,8 +0,0 @@
#!/bin/sh
mkdir -p ../../../alias
. ../../../nvm.sh
nvm install 0.10.1
nvm unload || echo >&2 'nvm unload failed'

5
test/installation/sourcing/teardown_dir

@ -1,5 +0,0 @@
#!/bin/sh
rm -rf ../../../alias
rm -rf ../../../v0.10.1

4
test/installation/sourcing/Sourcing nvm.sh should use the default if available → test/sourcing/Sourcing nvm.sh should use the default if available

@ -2,9 +2,9 @@
die () { echo $@ ; exit 1; } die () { echo $@ ; exit 1; }
echo '0.10.1' > ../../../alias/default || die 'creation of default alias failed' echo '0.10.1' > ../../alias/default || die 'creation of default alias failed'
. ../../../nvm.sh || die 'sourcing returned nonzero exit code' . ../../nvm.sh || die 'sourcing returned nonzero exit code'
NVM_LS_CURRENT="$(nvm ls current | \grep -o v0.10.1)" NVM_LS_CURRENT="$(nvm ls current | \grep -o v0.10.1)"
[ "_$NVM_LS_CURRENT" = '_v0.10.1' ] || die "'nvm ls current' did not return '-> v0.10.1', got '$NVM_LS_CURRENT'" [ "_$NVM_LS_CURRENT" = '_v0.10.1' ] || die "'nvm ls current' did not return '-> v0.10.1', got '$NVM_LS_CURRENT'"

12
test/sourcing/setup

@ -0,0 +1,12 @@
#!/bin/sh
mkdir -p ../../alias
rm -f ../../.nvmrc
rm -rf ../../v0.10.7
rm -rf ../../v0.9.7
rm -rf ../../v0.9.12
. ../../nvm.sh
nvm install 0.10.1 || echo >&2 'nvm install 0.10.1 failed'
nvm unload || echo >&2 'nvm unload failed'

7
test/sourcing/teardown

@ -0,0 +1,7 @@
#!/bin/sh
rm -rf ../../alias
rm -rf ../../v0.10.1
rm -rf ../../v0.10.2
rm -f ../../.nvmrc
Loading…
Cancel
Save