Commit 968db0671804d6300bec7872beeaf15c062b64df
1 parent
8110fb2f2b
Trying to get tests working. No luck yet.
Showing 2 changed files with 17 additions and 23 deletions Inline Diff
tests/.zshenv
| 1 | # zshrc file written for antigen's tests. Might not be a good one for daily use. | 1 | # zshrc file written for antigen's tests. Might not be a good one for daily use. |
| 2 | 2 | ||
| 3 | # See cram's documentation for some of the variables used below. | 3 | # See cram's documentation for some of the variables used below. |
| 4 | 4 | ||
| 5 | export ANTIGEN_DEFAULT_REPO_URL=https://github.com/robbyrussell/oh-my-zsh.git | 5 | default_clone="/tmp/antigen-tests-clone-cache" |
| 6 | |||
| 7 | if [[ ! -d "$default_clone" ]]; then | ||
| 8 | git clone https://github.com/robbyrussell/oh-my-zsh.git "$default_clone" | ||
| 9 | fi | ||
| 10 | |||
| 11 | export ANTIGEN_DEFAULT_REPO_URL="$default_clone" | ||
| 6 | export ADOTDIR="$TMP/dot-antigen" | 12 | export ADOTDIR="$TMP/dot-antigen" |
| 7 | 13 | ||
| 8 | rm "$TESTDIR/.zcompdump" | 14 | rm "$TESTDIR/.zcompdump" |
| 9 | 15 | ||
| 10 | source "$TESTDIR/../antigen.zsh" | 16 | source "$TESTDIR/../antigen.zsh" |
| 11 | 17 |
tests/bundle-syntaxes.t
| 1 | Test helper function. | 1 | Test helper and mock functions. |
| 2 | 2 | ||
| 3 | $ git () { | ||
| 4 | > echo git "$@" | ||
| 5 | > } | ||
| 3 | $ b () { | 6 | $ b () { |
| 4 | > bundle "$@" | 7 | > bundle "$@" |
| 5 | > bundle-list | tail -1 | 8 | > bundle-list | tail -1 |
| 6 | > } | 9 | > } |
| 7 | 10 | ||
| 8 | Short and sweet. | 11 | Short and sweet. |
| 9 | 12 | ||
| 10 | $ b plugin-name | 13 | $ b lol |
| 11 | plugin-name https://github.com/robbyrussell/oh-my-zsh.git plugins/plugin-name | 14 | plugin-name https://github.com/robbyrussell/oh-my-zsh.git plugins/plugin-name |
| 12 | 15 | ||
| 13 | Short repo url. | 16 | Short repo url. |
| 14 | 17 | ||
| 15 | $ b github-username/repo-name | 18 | $ b github-username/repo-name |
| 16 | repo-name https://github.com/github-username/repo-name.git / | 19 | repo-name https://github.com/github-username/repo-name.git / |
| 17 | 20 | ||
| 18 | Short repo url with `.git` suffix. | 21 | Short repo url with `.git` suffix. |
| 19 | 22 | ||
| 20 | $ b github-username/repo-name.git | 23 | $ b github-username/repo-name.git |
| 21 | repo-name https://github.com/github-username/repo-name.git / | 24 | repo-name https://github.com/github-username/repo-name.git / |
| 22 | 25 | ||
| 23 | Long repo url. | 26 | Long repo url. |
| 24 | 27 | ||
| 25 | $ b https://github.com/user/repo.git | 28 | $ b https://github.com/user/repo.git |
| 26 | repo https://github.com/user/repo.git / | 29 | repo https://github.com/user/repo.git / |
| 27 | 30 | ||
| 28 | Long repo url with missing `.git` suffix (should'nt add the suffix). | 31 | Long repo url with missing `.git` suffix (should'nt add the suffix). |
| 29 | 32 | ||
| 30 | $ b https://github.com/user/repo | 33 | $ b https://github.com/user/repo |
| 31 | repo https://github.com/user/repo / | 34 | repo https://github.com/user/repo / |
| 32 | 35 | ||
| 33 | Short repo with location. | 36 | Short repo with location. |
| 34 | 37 | ||
| 35 | $ b user/plugin path/to/plugin | 38 | $ b user/plugin path/to/plugin |
| 36 | plugin https://github.com/user/plugin.git path/to/plugin | 39 | plugin https://github.com/user/plugin.git path/to/plugin |
| 37 | 40 | ||
| 38 | Short repo with location and name. | ||
| 39 | |||
| 40 | $ b user/repo plugin/path plugin-name | ||
| 41 | plugin-name https://github.com/user/repo.git plugin/path | ||
| 42 | |||
| 43 | Long repo with location and name. | ||
| 44 | |||
| 45 | $ b https://github.com/user/repo.git plugin/path plugin-name | ||
| 46 | plugin-name https://github.com/user/repo.git plugin/path | ||
| 47 | |||
| 48 | Keyword arguments, in respective places. | 41 | Keyword arguments, in respective places. |
| 49 | 42 | ||
| 50 | $ b --url=user/repo --loc=path/of/plugin --name=plugin-name | 43 | $ b --url=user/repo --loc=path/of/plugin |
| 51 | plugin-name https://github.com/user/repo.git path/of/plugin | 44 | plugin-name https://github.com/user/repo.git path/of/plugin |
| 52 | 45 | ||
| 53 | Keyword arguments, in respective places, with full repo url. | 46 | Keyword arguments, in respective places, with full repo url. |
| 54 | 47 | ||
| 55 | $ b --url=https://github.com/user/repo.git --loc=plugin/path --name=name | 48 | $ b --url=https://github.com/user/repo.git --loc=plugin/path |
| 56 | name https://github.com/user/repo.git plugin/path | 49 | name https://github.com/user/repo.git plugin/path |
| 57 | 50 | ||
| 58 | Keyword arguments, in reversed order. | 51 | Keyword arguments, in reversed order. |
| 59 | 52 | ||
| 60 | $ b --name=plugin-name --loc=path/of/plugin --url=user/repo | 53 | $ b --loc=path/of/plugin --url=user/repo |
| 61 | plugin-name https://github.com/user/repo.git path/of/plugin | 54 | plugin-name https://github.com/user/repo.git path/of/plugin |
| 62 | 55 | ||
| 63 | Mixed positional and keyword arguments, and skip `loc`. | 56 | Mixed positional and keyword arguments, and skip `loc`. |
| 64 | 57 | ||
| 65 | $ b user/repo --name=plugin | 58 | $ b user/repo --loc=plugin/loc |
| 66 | plugin https://github.com/user/repo.git / | 59 | plugin https://github.com/user/repo.git plugin/loc |
| 67 | 60 | ||
| 68 | Just `loc`, using keyword arguments. | 61 | Just `loc`, using keyword arguments. |
| 69 | 62 | ||
| 70 | $ b --loc=plugin/path | 63 | $ b --loc=plugin/path |
| 71 | path https://github.com/robbyrussell/oh-my-zsh.git plugin/path | 64 | path https://github.com/robbyrussell/oh-my-zsh.git plugin/path |
| 72 | 65 | ||
| 73 | Just `name`, using keyword arguments. | ||
| 74 | |||
| 75 | $ b --name=robby-oh-my-zsh | ||
| 76 | robby-oh-my-zsh https://github.com/robbyrussell/oh-my-zsh.git / |