Commit 968db0671804d6300bec7872beeaf15c062b64df
1 parent
8110fb2f2b
Trying to get tests working. No luck yet.
Showing 2 changed files with 17 additions and 23 deletions Side-by-side Diff
tests/.zshenv
... | ... | @@ -2,7 +2,13 @@ |
2 | 2 | |
3 | 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 | 12 | export ADOTDIR="$TMP/dot-antigen" |
7 | 13 | |
8 | 14 | rm "$TESTDIR/.zcompdump" |
tests/bundle-syntaxes.t
1 | -Test helper function. | |
1 | +Test helper and mock functions. | |
2 | 2 | |
3 | + $ git () { | |
4 | + > echo git "$@" | |
5 | + > } | |
3 | 6 | $ b () { |
4 | 7 | > bundle "$@" |
5 | 8 | > bundle-list | tail -1 |
... | ... | @@ -7,7 +10,7 @@ Test helper function. |
7 | 10 | |
8 | 11 | Short and sweet. |
9 | 12 | |
10 | - $ b plugin-name | |
13 | + $ b lol | |
11 | 14 | plugin-name https://github.com/robbyrussell/oh-my-zsh.git plugins/plugin-name |
12 | 15 | |
13 | 16 | Short repo url. |
... | ... | @@ -35,44 +38,29 @@ Short repo with location. |
35 | 38 | $ b user/plugin path/to/plugin |
36 | 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 | 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 | 44 | plugin-name https://github.com/user/repo.git path/of/plugin |
52 | 45 | |
53 | 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 | 49 | name https://github.com/user/repo.git plugin/path |
57 | 50 | |
58 | 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 | 54 | plugin-name https://github.com/user/repo.git path/of/plugin |
62 | 55 | |
63 | 56 | Mixed positional and keyword arguments, and skip `loc`. |
64 | 57 | |
65 | - $ b user/repo --name=plugin | |
66 | - plugin https://github.com/user/repo.git / | |
58 | + $ b user/repo --loc=plugin/loc | |
59 | + plugin https://github.com/user/repo.git plugin/loc | |
67 | 60 | |
68 | 61 | Just `loc`, using keyword arguments. |
69 | 62 | |
70 | 63 | $ b --loc=plugin/path |
71 | 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 / | |
77 | - | |
78 | 66 | TODO: Error reporting with erroneous arguments or usage with incorrect syntax. |