fast tests

This commit is contained in:
Thomas Levine 2012-10-10 19:51:00 -04:00
parent 2eeea14805
commit 9454096bc6
5 changed files with 42 additions and 1 deletions

6
test/fast/deactivate Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
. ../../nvm.sh
nvm &&
nvm deactivate &&
! nvm

9
test/fast/ls Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
. ../../nvm.sh
mkdir -p ../../v0.0.{1,3,9}
# The result should contain the version numbers.
nvm ls | grep v0.0.1 &&
nvm ls | grep v0.0.3 &&
nvm ls | grep v0.0.9

10
test/fast/setup Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
set -e
(
cd ../..
# Back up
mkdir -p bak
mv v* src alias bak || sleep 0s
)

View File

@ -1,4 +1,4 @@
#!/bin/sh
. ../nvm.sh
. ../../nvm.sh
nvm

16
test/fast/teardown Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
set -e
(
cd ../..
# Remove temporary files
rm -fR v* src alias
# Restore
if [ -d bak ]
then
mv bak/* . || sleep 0s
rmdir bak
fi
)