Commit aea2f87bdd811f24eb83b87e5a8e229dc0662e7f
1 parent
efbdc718d0
Refactor bundle tests for readability.
Showing 1 changed file with 5 additions and 17 deletions Inline Diff
tests/bundle-syntaxes.t
1 | Helper aliases. | 1 | Test helper function. |
2 | 2 | ||
3 | $ alias b=bundle | 3 | $ b () { |
4 | $ alias lb='bundle-list | tail -1' # lb = last bundle | 4 | > bundle "$@" |
5 | > bundle-list | tail -1 | ||
6 | > } | ||
5 | 7 | ||
6 | Short and sweet. | 8 | Short and sweet. |
7 | 9 | ||
8 | $ b plugin-name | 10 | $ b plugin-name |
9 | $ lb | ||
10 | plugin-name https://github.com/robbyrussell/oh-my-zsh.git plugins/plugin-name | 11 | plugin-name https://github.com/robbyrussell/oh-my-zsh.git plugins/plugin-name |
11 | 12 | ||
12 | Short repo url. | 13 | Short repo url. |
13 | 14 | ||
14 | $ b github-username/repo-name | 15 | $ b github-username/repo-name |
15 | $ lb | ||
16 | repo-name https://github.com/github-username/repo-name.git / | 16 | repo-name https://github.com/github-username/repo-name.git / |
17 | 17 | ||
18 | Short repo url with `.git` suffix. | 18 | Short repo url with `.git` suffix. |
19 | 19 | ||
20 | $ b github-username/repo-name.git | 20 | $ b github-username/repo-name.git |
21 | $ lb | ||
22 | repo-name https://github.com/github-username/repo-name.git / | 21 | repo-name https://github.com/github-username/repo-name.git / |
23 | 22 | ||
24 | Long repo url. | 23 | Long repo url. |
25 | 24 | ||
26 | $ b https://github.com/user/repo.git | 25 | $ b https://github.com/user/repo.git |
27 | $ lb | ||
28 | repo https://github.com/user/repo.git / | 26 | repo https://github.com/user/repo.git / |
29 | 27 | ||
30 | Long repo url with missing `.git` suffix (should'nt add the suffix). | 28 | Long repo url with missing `.git` suffix (should'nt add the suffix). |
31 | 29 | ||
32 | $ b https://github.com/user/repo | 30 | $ b https://github.com/user/repo |
33 | $ lb | ||
34 | repo https://github.com/user/repo / | 31 | repo https://github.com/user/repo / |
35 | 32 | ||
36 | Short repo with location. | 33 | Short repo with location. |
37 | 34 | ||
38 | $ b user/plugin path/to/plugin | 35 | $ b user/plugin path/to/plugin |
39 | $ lb | ||
40 | plugin https://github.com/user/plugin.git path/to/plugin | 36 | plugin https://github.com/user/plugin.git path/to/plugin |
41 | 37 | ||
42 | Short repo with location and name. | 38 | Short repo with location and name. |
43 | 39 | ||
44 | $ b user/repo plugin/path plugin-name | 40 | $ b user/repo plugin/path plugin-name |
45 | $ lb | ||
46 | plugin-name https://github.com/user/repo.git plugin/path | 41 | plugin-name https://github.com/user/repo.git plugin/path |
47 | 42 | ||
48 | Long repo with location and name. | 43 | Long repo with location and name. |
49 | 44 | ||
50 | $ b https://github.com/user/repo.git plugin/path plugin-name | 45 | $ b https://github.com/user/repo.git plugin/path plugin-name |
51 | $ lb | ||
52 | plugin-name https://github.com/user/repo.git plugin/path | 46 | plugin-name https://github.com/user/repo.git plugin/path |
53 | 47 | ||
54 | Keyword arguments, in respective places. | 48 | Keyword arguments, in respective places. |
55 | 49 | ||
56 | $ b --url=user/repo --loc=path/of/plugin --name=plugin-name | 50 | $ b --url=user/repo --loc=path/of/plugin --name=plugin-name |
57 | $ lb | ||
58 | plugin-name https://github.com/user/repo.git path/of/plugin | 51 | plugin-name https://github.com/user/repo.git path/of/plugin |
59 | 52 | ||
60 | Keyword arguments, in respective places, with full repo url. | 53 | Keyword arguments, in respective places, with full repo url. |
61 | 54 | ||
62 | $ b --url=https://github.com/user/repo.git --loc=plugin/path --name=name | 55 | $ b --url=https://github.com/user/repo.git --loc=plugin/path --name=name |
63 | $ lb | ||
64 | name https://github.com/user/repo.git plugin/path | 56 | name https://github.com/user/repo.git plugin/path |
65 | 57 | ||
66 | Keyword arguments, in reversed order. | 58 | Keyword arguments, in reversed order. |
67 | 59 | ||
68 | $ b --name=plugin-name --loc=path/of/plugin --url=user/repo | 60 | $ b --name=plugin-name --loc=path/of/plugin --url=user/repo |
69 | $ lb | ||
70 | plugin-name https://github.com/user/repo.git path/of/plugin | 61 | plugin-name https://github.com/user/repo.git path/of/plugin |
71 | 62 | ||
72 | Mixed positional and keyword arguments, and skip `loc`. | 63 | Mixed positional and keyword arguments, and skip `loc`. |
73 | 64 | ||
74 | $ b user/repo --name=plugin | 65 | $ b user/repo --name=plugin |
75 | $ lb | ||
76 | plugin https://github.com/user/repo.git / | 66 | plugin https://github.com/user/repo.git / |
77 | 67 | ||
78 | Just `loc`, using keyword arguments. | 68 | Just `loc`, using keyword arguments. |
79 | 69 | ||
80 | $ b --loc=plugin/path | 70 | $ b --loc=plugin/path |
81 | $ lb | ||
82 | path https://github.com/robbyrussell/oh-my-zsh.git plugin/path | 71 | path https://github.com/robbyrussell/oh-my-zsh.git plugin/path |
83 | 72 | ||
84 | Just `name`, using keyword arguments. | 73 | Just `name`, using keyword arguments. |
85 | 74 | ||
86 | $ b --name=robby-oh-my-zsh | 75 | $ b --name=robby-oh-my-zsh |
87 | $ lb | ||
88 | robby-oh-my-zsh https://github.com/robbyrussell/oh-my-zsh.git / | 76 | robby-oh-my-zsh https://github.com/robbyrussell/oh-my-zsh.git / |
89 | 77 |