Commit fe44337cbba8ddfbe7d859c636dd70eb1865ea4e
1 parent
35c893da7a
Add test file for bundle command syntaxes.
Tests are currently failing and already helped me spot a bug with the argument parsing (That's where the tests fail).
Showing 1 changed file with 85 additions and 0 deletions Inline Diff
tests/bundle-syntaxes.t
| File was created | 1 | Helper aliases. | |
| 2 | |||
| 3 | $ alias b=bundle | ||
| 4 | $ alias lb='bundle-list | tail -1' # lb = last bundle | ||
| 5 | |||
| 6 | Short and sweet. | ||
| 7 | |||
| 8 | $ b plugin-name | ||
| 9 | $ lb | ||
| 10 | plugin-name https://github.com/robbyrussell/oh-my-zsh.git plugins/plugin-name | ||
| 11 | |||
| 12 | Short repo url. | ||
| 13 | |||
| 14 | $ b github-username/repo-name | ||
| 15 | $ lb | ||
| 16 | repo-name https://github.com/github-username/repo-name.git / | ||
| 17 | |||
| 18 | Short repo url with `.git` suffix. | ||
| 19 | |||
| 20 | $ b github-username/repo-name.git | ||
| 21 | $ lb | ||
| 22 | repo-name https://github.com/github-username/repo-name.git / | ||
| 23 | |||
| 24 | Long repo url. | ||
| 25 | |||
| 26 | $ b https://github.com/user/repo.git | ||
| 27 | $ lb | ||
| 28 | repo https://github.com/user/repo.git / | ||
| 29 | |||
| 30 | Long repo url with missing `.git` suffix (should'nt add the suffix). | ||
| 31 | |||
| 32 | $ b https://github.com/user/repo | ||
| 33 | $ lb | ||
| 34 | repo https://github.com/user/repo / | ||
| 35 | |||
| 36 | Short repo with location. | ||
| 37 | |||
| 38 | $ b user/plugin path/to/plugin | ||
| 39 | $ lb | ||
| 40 | plugin https://github.com/user/plugin.git path/to/plugin | ||
| 41 | |||
| 42 | Short repo with location and name. | ||
| 43 | |||
| 44 | $ b user/repo plugin/path plugin-name | ||
| 45 | $ lb | ||
| 46 | plugin-name https://github.com/user/repo.git plugin/path | ||
| 47 | |||
| 48 | Long repo with location and name. | ||
| 49 | |||
| 50 | $ b https://github.com/user/repo plugin/path plugin-name | ||
| 51 | $ lb | ||
| 52 | plugin-name https://github.com/user/repo.git plugin/path | ||
| 53 | |||
| 54 | Keyword arguments, in respective places. | ||
| 55 | |||
| 56 | $ 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 | ||
| 59 | |||
| 60 | Keyword arguments, in respective places, with full repo url. | ||
| 61 | |||
| 62 | $ 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 | ||
| 65 | |||
| 66 | Keyword arguments, in reversed order. | ||
| 67 | |||
| 68 | $ 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 | ||
| 71 | |||
| 72 | Mixed positional and keyword arguments, and skip `loc`. | ||
| 73 | |||
| 74 | $ b user/repo --name=plugin | ||
| 75 | plugin https://github.com/user/repo.git / | ||
| 76 | |||
| 77 | Just `loc`, using keyword arguments. | ||
| 78 | |||
| 79 | $ b --loc=plugin/path | ||
| 80 | path https://github.com/robbyrussell/oh-my-zsh.git plugin/path | ||
| 81 | |||
| 82 | Just `name`, using keyword arguments. | ||
| 83 | |||
| 84 | $ b --name=robby-oh-my-zsh | ||
| 85 | robby-oh-my-zsh https://github.com/robbyrussell/oh-my-zsh.git / | ||
| 86 |