Commit 889cc93f91d8e250b7b61abc3350ddbc0fac4b56
1 parent
fe11682993
Add/Unskip tests for bundle syntaxes.
Showing 1 changed file with 56 additions and 20 deletions Side-by-side Diff
tests/bundle-syntaxes.t
1 | -Skip test. | |
2 | - | |
3 | - $ exit 80 | |
4 | - | |
5 | 1 | Test helper and mock functions. |
6 | 2 | |
7 | - $ git () { | |
8 | - > echo git "$@" | |
9 | - > } | |
3 | + $ ANTIGEN_DEFAULT_REPO_URL=gh-user/repo | |
4 | + | |
10 | 5 | $ b () { |
11 | - > bundle "$@" | |
12 | - > bundle-list | tail -1 | |
6 | + > antigen-bundle "$@" | |
7 | + > } | |
8 | + | |
9 | + $ -antigen-ensure-repo () {} | |
10 | + | |
11 | + $ -antigen-load () { | |
12 | + > echo "url: $1" | |
13 | + > echo "dir: $2" | |
14 | + > echo "is a: $3" | |
15 | + > echo "clone?: $4" | |
13 | 16 | > } |
14 | 17 | |
15 | 18 | Short and sweet. |
16 | 19 | |
17 | 20 | $ b lol |
18 | - plugin-name https://github.com/robbyrussell/oh-my-zsh.git plugins/plugin-name | |
21 | + url: https://github.com/gh-user/repo.git | |
22 | + dir: plugins/lol | |
23 | + is a: plugin | |
24 | + clone?: true | |
19 | 25 | |
20 | 26 | Short repo url. |
21 | 27 | |
22 | 28 | $ b github-username/repo-name |
23 | - repo-name https://github.com/github-username/repo-name.git / | |
29 | + url: https://github.com/github-username/repo-name.git | |
30 | + dir: / | |
31 | + is a: plugin | |
32 | + clone?: true | |
24 | 33 | |
25 | 34 | Short repo url with `.git` suffix. |
26 | 35 | |
27 | 36 | $ b github-username/repo-name.git |
28 | - repo-name https://github.com/github-username/repo-name.git / | |
37 | + url: https://github.com/github-username/repo-name.git | |
38 | + dir: / | |
39 | + is a: plugin | |
40 | + clone?: true | |
29 | 41 | |
30 | 42 | Long repo url. |
31 | 43 | |
32 | 44 | $ b https://github.com/user/repo.git |
33 | - repo https://github.com/user/repo.git / | |
45 | + url: https://github.com/user/repo.git | |
46 | + dir: / | |
47 | + is a: plugin | |
48 | + clone?: true | |
34 | 49 | |
35 | 50 | Long repo url with missing `.git` suffix (should'nt add the suffix). |
36 | 51 | |
37 | 52 | $ b https://github.com/user/repo |
38 | - repo https://github.com/user/repo / | |
53 | + url: https://github.com/user/repo | |
54 | + dir: / | |
55 | + is a: plugin | |
56 | + clone?: true | |
39 | 57 | |
40 | 58 | Short repo with location. |
41 | 59 | |
42 | 60 | $ b user/plugin path/to/plugin |
43 | - plugin https://github.com/user/plugin.git path/to/plugin | |
61 | + url: https://github.com/user/plugin.git | |
62 | + dir: path/to/plugin | |
63 | + is a: plugin | |
64 | + clone?: true | |
44 | 65 | |
45 | 66 | Keyword arguments, in respective places. |
46 | 67 | |
47 | 68 | $ b --url=user/repo --loc=path/of/plugin |
48 | - plugin-name https://github.com/user/repo.git path/of/plugin | |
69 | + url: https://github.com/user/repo.git | |
70 | + dir: path/of/plugin | |
71 | + is a: plugin | |
72 | + clone?: true | |
49 | 73 | |
50 | 74 | Keyword arguments, in respective places, with full repo url. |
51 | 75 | |
52 | 76 | $ b --url=https://github.com/user/repo.git --loc=plugin/path |
53 | - name https://github.com/user/repo.git plugin/path | |
77 | + url: https://github.com/user/repo.git | |
78 | + dir: plugin/path | |
79 | + is a: plugin | |
80 | + clone?: true | |
54 | 81 | |
55 | 82 | Keyword arguments, in reversed order. |
56 | 83 | |
57 | 84 | $ b --loc=path/of/plugin --url=user/repo |
58 | - plugin-name https://github.com/user/repo.git path/of/plugin | |
85 | + url: https://github.com/user/repo.git | |
86 | + dir: path/of/plugin | |
87 | + is a: plugin | |
88 | + clone?: true | |
59 | 89 | |
60 | 90 | Mixed positional and keyword arguments, and skip `loc`. |
61 | 91 | |
62 | 92 | $ b user/repo --loc=plugin/loc |
63 | - plugin https://github.com/user/repo.git plugin/loc | |
93 | + url: https://github.com/user/repo.git | |
94 | + dir: plugin/loc | |
95 | + is a: plugin | |
96 | + clone?: true | |
64 | 97 | |
65 | 98 | Just `loc`, using keyword arguments. |
66 | 99 | |
67 | 100 | $ b --loc=plugin/path |
68 | - path https://github.com/robbyrussell/oh-my-zsh.git plugin/path | |
101 | + url: https://github.com/gh-user/repo.git | |
102 | + dir: plugin/path | |
103 | + is a: plugin | |
104 | + clone?: true | |
69 | 105 | |
70 | 106 | TODO: Error reporting with erroneous arguments or usage with incorrect syntax. |