diff --git a/.gitignore b/.gitignore index 490dc76..49b3b8a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ +tests/.urchin.log previous_version diff --git a/tests/common.sh b/tests/common.sh new file mode 100644 index 0000000..70c8f73 --- /dev/null +++ b/tests/common.sh @@ -0,0 +1,11 @@ +export test_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +export repo_dir="$test_dir/.." + +die () { + echo $@ + exit 1 +} + +load_zsh_nvm() { + source "$repo_dir/zsh-nvm.plugin.zsh" +} diff --git a/tests/loading/Check zsh-nvm is loaded b/tests/loading/Check zsh-nvm is loaded new file mode 100755 index 0000000..fa391d4 --- /dev/null +++ b/tests/loading/Check zsh-nvm is loaded @@ -0,0 +1,10 @@ +source ../common.sh + +# Check ZSH_NVM_DIR isn't already set +[[ -z ${ZSH_NVM_DIR+x} ]] || die "ZSH_NVM_DIR already set" + +# Load zsh-nvm +load_zsh_nvm + +# Check ZSH_NVM_DIR is now set +[[ ! -z ${ZSH_NVM_DIR+x} ]] || die "ZSH_NVM_DIR wasn't set"