From ee520abf78add0afcd9f52311c7467dab26c1e11 Mon Sep 17 00:00:00 2001 From: Daniel Bretoi Date: Fri, 21 Nov 2014 17:51:49 -0800 Subject: [PATCH] adding some tests for nvm which --- ....0.2\" should display only version 0.0.2." | 20 +++++++++++++++++++ test/fast/Listing paths/teardown | 17 ++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100755 "test/fast/Listing paths/Running \"nvm which 0.0.2\" should display only version 0.0.2." create mode 100755 test/fast/Listing paths/teardown diff --git "a/test/fast/Listing paths/Running \"nvm which 0.0.2\" should display only version 0.0.2." "b/test/fast/Listing paths/Running \"nvm which 0.0.2\" should display only version 0.0.2." new file mode 100755 index 0000000..53ddf30 --- /dev/null +++ "b/test/fast/Listing paths/Running \"nvm which 0.0.2\" should display only version 0.0.2." @@ -0,0 +1,20 @@ +#!/bin/sh + +mkdir ../../../v0.0.2 +mkdir ../../../v0.0.20 + +. ../../../nvm.sh + +die () { echo $@ ; exit 1; } + +# The result should contain only the appropriate version numbers. + +nvm which 0.0.2 | grep "$NVM_DIR/v0.0.2/bin" > /dev/null +if [ $? -ne 0 ]; then + die '"nvm which 0.0.2" did not contain the correct path' +fi + +nvm which 0.0.20 | grep "$NVM_DIR/v0.0.20/bin" > /dev/null +if [ $? -ne 0 ]; then + die '"nvm which 0.0.2" did not contain the correct path' +fi diff --git a/test/fast/Listing paths/teardown b/test/fast/Listing paths/teardown new file mode 100755 index 0000000..25669ea --- /dev/null +++ b/test/fast/Listing paths/teardown @@ -0,0 +1,17 @@ +rmdir ../../../v0.0.1 >/dev/null 2>&1 +rmdir ../../../v0.0.2 >/dev/null 2>&1 +rmdir ../../../v0.0.3 >/dev/null 2>&1 +rmdir ../../../v0.0.9 >/dev/null 2>&1 +rmdir ../../../v0.0.20 >/dev/null 2>&1 +rmdir ../../../v0.1.2 >/dev/null 2>&1 +rmdir ../../../v0.1.3 >/dev/null 2>&1 +rmdir ../../../v0.2.3 >/dev/null 2>&1 +rmdir ../../../v0.3.1 >/dev/null 2>&1 +rmdir ../../../v0.3.3 >/dev/null 2>&1 +rmdir ../../../v0.3.9 >/dev/null 2>&1 +rmdir ../../../v0.20.3 >/dev/null 2>&1 +rmdir ../../../versions >/dev/null 2>&1 +unalias nvm_has_system_node >/dev/null 2>&1 +rm -f ../../../alias/stable >/dev/null 2>&1 +rm -f ../../../alias/unstable >/dev/null 2>&1 +