From 889cc93f91d8e250b7b61abc3350ddbc0fac4b56 Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Date: Sat, 19 Jan 2013 13:15:17 +0530 Subject: [PATCH] Add/Unskip tests for bundle syntaxes. --- tests/bundle-syntaxes.t | 76 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 56 insertions(+), 20 deletions(-) diff --git a/tests/bundle-syntaxes.t b/tests/bundle-syntaxes.t index bdf31df..71979e5 100644 --- a/tests/bundle-syntaxes.t +++ b/tests/bundle-syntaxes.t @@ -1,70 +1,106 @@ -Skip test. - - $ exit 80 - Test helper and mock functions. - $ git () { - > echo git "$@" - > } + $ ANTIGEN_DEFAULT_REPO_URL=gh-user/repo + $ b () { - > bundle "$@" - > bundle-list | tail -1 + > antigen-bundle "$@" + > } + + $ -antigen-ensure-repo () {} + + $ -antigen-load () { + > echo "url: $1" + > echo "dir: $2" + > echo "is a: $3" + > echo "clone?: $4" > } Short and sweet. $ b lol - plugin-name https://github.com/robbyrussell/oh-my-zsh.git plugins/plugin-name + url: https://github.com/gh-user/repo.git + dir: plugins/lol + is a: plugin + clone?: true Short repo url. $ b github-username/repo-name - repo-name https://github.com/github-username/repo-name.git / + url: https://github.com/github-username/repo-name.git + dir: / + is a: plugin + clone?: true Short repo url with `.git` suffix. $ b github-username/repo-name.git - repo-name https://github.com/github-username/repo-name.git / + url: https://github.com/github-username/repo-name.git + dir: / + is a: plugin + clone?: true Long repo url. $ b https://github.com/user/repo.git - repo https://github.com/user/repo.git / + url: https://github.com/user/repo.git + dir: / + is a: plugin + clone?: true Long repo url with missing `.git` suffix (should'nt add the suffix). $ b https://github.com/user/repo - repo https://github.com/user/repo / + url: https://github.com/user/repo + dir: / + is a: plugin + clone?: true Short repo with location. $ b user/plugin path/to/plugin - plugin https://github.com/user/plugin.git path/to/plugin + url: https://github.com/user/plugin.git + dir: path/to/plugin + is a: plugin + clone?: true Keyword arguments, in respective places. $ b --url=user/repo --loc=path/of/plugin - plugin-name https://github.com/user/repo.git path/of/plugin + url: https://github.com/user/repo.git + dir: path/of/plugin + is a: plugin + clone?: true Keyword arguments, in respective places, with full repo url. $ b --url=https://github.com/user/repo.git --loc=plugin/path - name https://github.com/user/repo.git plugin/path + url: https://github.com/user/repo.git + dir: plugin/path + is a: plugin + clone?: true Keyword arguments, in reversed order. $ b --loc=path/of/plugin --url=user/repo - plugin-name https://github.com/user/repo.git path/of/plugin + url: https://github.com/user/repo.git + dir: path/of/plugin + is a: plugin + clone?: true Mixed positional and keyword arguments, and skip `loc`. $ b user/repo --loc=plugin/loc - plugin https://github.com/user/repo.git plugin/loc + url: https://github.com/user/repo.git + dir: plugin/loc + is a: plugin + clone?: true Just `loc`, using keyword arguments. $ b --loc=plugin/path - path https://github.com/robbyrussell/oh-my-zsh.git plugin/path + url: https://github.com/gh-user/repo.git + dir: plugin/path + is a: plugin + clone?: true TODO: Error reporting with erroneous arguments or usage with incorrect syntax. -- 2.0.0