From c7ee42d5c5f7589b680a393716cd4db77fd4fcfd Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Tue, 18 Oct 2016 14:52:36 +0100 Subject: [PATCH] Test zsh-nvm doesn't overwrite nvm installs --- ...doesn't install nvm if it's already installed | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 tests/loading/Check zsh-nvm doesn't install nvm if it's already installed diff --git a/tests/loading/Check zsh-nvm doesn't install nvm if it's already installed b/tests/loading/Check zsh-nvm doesn't install nvm if it's already installed new file mode 100755 index 0000000..c1a39aa --- /dev/null +++ b/tests/loading/Check zsh-nvm doesn't install nvm if it's already installed @@ -0,0 +1,16 @@ +source ../common.sh + +nvm_placeholder="nvm placeholder" + +# Fake nvm installation +mkdir "$NVM_DIR" +echo "$nvm_placeholder" > "$NVM_DIR/nvm.sh" + +# Check fake nvm file is there +[[ -f "$NVM_DIR/nvm.sh" ]] || die "Fake nvm file wasn't created" + +# Load zsh-nvm +load_zsh_nvm + +# Check fake nvm installation wasn't overwritten +[[ $(cat "$NVM_DIR/nvm.sh") == "$nvm_placeholder" ]] || die "Existing nvm installation was overwritten"