From 968db0671804d6300bec7872beeaf15c062b64df Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Date: Fri, 8 Jun 2012 20:03:07 +0530 Subject: [PATCH] Trying to get tests working. No luck yet. --- tests/.zshenv | 8 +++++++- tests/bundle-syntaxes.t | 32 ++++++++++---------------------- 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/tests/.zshenv b/tests/.zshenv index 2a5cc40..7b5f699 100644 --- a/tests/.zshenv +++ b/tests/.zshenv @@ -2,7 +2,13 @@ # See cram's documentation for some of the variables used below. -export ANTIGEN_DEFAULT_REPO_URL=https://github.com/robbyrussell/oh-my-zsh.git +default_clone="/tmp/antigen-tests-clone-cache" + +if [[ ! -d "$default_clone" ]]; then + git clone https://github.com/robbyrussell/oh-my-zsh.git "$default_clone" +fi + +export ANTIGEN_DEFAULT_REPO_URL="$default_clone" export ADOTDIR="$TMP/dot-antigen" rm "$TESTDIR/.zcompdump" diff --git a/tests/bundle-syntaxes.t b/tests/bundle-syntaxes.t index c71b6f7..8694266 100644 --- a/tests/bundle-syntaxes.t +++ b/tests/bundle-syntaxes.t @@ -1,5 +1,8 @@ -Test helper function. +Test helper and mock functions. + $ git () { + > echo git "$@" + > } $ b () { > bundle "$@" > bundle-list | tail -1 @@ -7,7 +10,7 @@ Test helper function. Short and sweet. - $ b plugin-name + $ b lol plugin-name https://github.com/robbyrussell/oh-my-zsh.git plugins/plugin-name Short repo url. @@ -35,44 +38,29 @@ Short repo with location. $ b user/plugin path/to/plugin plugin https://github.com/user/plugin.git path/to/plugin -Short repo with location and name. - - $ b user/repo plugin/path plugin-name - plugin-name https://github.com/user/repo.git plugin/path - -Long repo with location and name. - - $ b https://github.com/user/repo.git plugin/path plugin-name - plugin-name https://github.com/user/repo.git plugin/path - Keyword arguments, in respective places. - $ b --url=user/repo --loc=path/of/plugin --name=plugin-name + $ b --url=user/repo --loc=path/of/plugin plugin-name https://github.com/user/repo.git path/of/plugin Keyword arguments, in respective places, with full repo url. - $ b --url=https://github.com/user/repo.git --loc=plugin/path --name=name + $ b --url=https://github.com/user/repo.git --loc=plugin/path name https://github.com/user/repo.git plugin/path Keyword arguments, in reversed order. - $ b --name=plugin-name --loc=path/of/plugin --url=user/repo + $ b --loc=path/of/plugin --url=user/repo plugin-name https://github.com/user/repo.git path/of/plugin Mixed positional and keyword arguments, and skip `loc`. - $ b user/repo --name=plugin - plugin https://github.com/user/repo.git / + $ b user/repo --loc=plugin/loc + plugin https://github.com/user/repo.git plugin/loc Just `loc`, using keyword arguments. $ b --loc=plugin/path path https://github.com/robbyrussell/oh-my-zsh.git plugin/path -Just `name`, using keyword arguments. - - $ b --name=robby-oh-my-zsh - robby-oh-my-zsh https://github.com/robbyrussell/oh-my-zsh.git / - TODO: Error reporting with erroneous arguments or usage with incorrect syntax. -- 2.0.0