Commit 889cc93f91d8e250b7b61abc3350ddbc0fac4b56

Authored by Shrikant Sharat
1 parent fe11682993

Add/Unskip tests for bundle syntaxes.

Showing 1 changed file with 56 additions and 20 deletions Inline Diff

tests/bundle-syntaxes.t
1 Skip test.
2
3 $ exit 80
4
5 Test helper and mock functions. 1 Test helper and mock functions.
6 2
7 $ git () { 3 $ ANTIGEN_DEFAULT_REPO_URL=gh-user/repo
8 > echo git "$@" 4
9 > }
10 $ b () { 5 $ b () {
11 > bundle "$@" 6 > antigen-bundle "$@"
12 > bundle-list | tail -1 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 Short and sweet. 18 Short and sweet.
16 19
17 $ b lol 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 Short repo url. 26 Short repo url.
21 27
22 $ b github-username/repo-name 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 Short repo url with `.git` suffix. 34 Short repo url with `.git` suffix.
26 35
27 $ b github-username/repo-name.git 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 Long repo url. 42 Long repo url.
31 43
32 $ b https://github.com/user/repo.git 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 Long repo url with missing `.git` suffix (should'nt add the suffix). 50 Long repo url with missing `.git` suffix (should'nt add the suffix).
36 51
37 $ b https://github.com/user/repo 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 Short repo with location. 58 Short repo with location.
41 59
42 $ b user/plugin path/to/plugin 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 Keyword arguments, in respective places. 66 Keyword arguments, in respective places.
46 67
47 $ b --url=user/repo --loc=path/of/plugin 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 Keyword arguments, in respective places, with full repo url. 74 Keyword arguments, in respective places, with full repo url.
51 75
52 $ b --url=https://github.com/user/repo.git --loc=plugin/path 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 Keyword arguments, in reversed order. 82 Keyword arguments, in reversed order.
56 83
57 $ b --loc=path/of/plugin --url=user/repo 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 Mixed positional and keyword arguments, and skip `loc`. 90 Mixed positional and keyword arguments, and skip `loc`.
61 91
62 $ b user/repo --loc=plugin/loc 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 Just `loc`, using keyword arguments. 98 Just `loc`, using keyword arguments.
66 99
67 $ b --loc=plugin/path 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