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