Blame view

tests/bundle-syntaxes.t 2.21 KB
968db0671   Shrikant Sharat   Trying to get tes...
1
  Test helper and mock functions.
fe44337cb   Shrikant Sharat   Add test file for...
2

889cc93f9   Shrikant Sharat   Add/Unskip tests ...
3
    $ ANTIGEN_DEFAULT_REPO_URL=gh-user/repo
aea2f87bd   Shrikant Sharat   Refactor bundle t...
4
    $ b () {
889cc93f9   Shrikant Sharat   Add/Unskip tests ...
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   Shrikant Sharat   Refactor bundle t...
15
    > }
fe44337cb   Shrikant Sharat   Add test file for...
16
17
  
  Short and sweet.
968db0671   Shrikant Sharat   Trying to get tes...
18
    $ b lol
889cc93f9   Shrikant Sharat   Add/Unskip tests ...
19
20
21
22
    url:    https://github.com/gh-user/repo.git
    dir:    plugins/lol
    is a:   plugin
    clone?: true
fe44337cb   Shrikant Sharat   Add test file for...
23
24
25
26
  
  Short repo url.
  
    $ b github-username/repo-name
889cc93f9   Shrikant Sharat   Add/Unskip tests ...
27
28
29
30
    url:    https://github.com/github-username/repo-name.git
    dir:    /
    is a:   plugin
    clone?: true
fe44337cb   Shrikant Sharat   Add test file for...
31
32
33
34
  
  Short repo url with `.git` suffix.
  
    $ b github-username/repo-name.git
889cc93f9   Shrikant Sharat   Add/Unskip tests ...
35
36
37
38
    url:    https://github.com/github-username/repo-name.git
    dir:    /
    is a:   plugin
    clone?: true
fe44337cb   Shrikant Sharat   Add test file for...
39
40
41
42
  
  Long repo url.
  
    $ b https://github.com/user/repo.git
889cc93f9   Shrikant Sharat   Add/Unskip tests ...
43
44
45
46
    url:    https://github.com/user/repo.git
    dir:    /
    is a:   plugin
    clone?: true
fe44337cb   Shrikant Sharat   Add test file for...
47
48
49
50
  
  Long repo url with missing `.git` suffix (should'nt add the suffix).
  
    $ b https://github.com/user/repo
889cc93f9   Shrikant Sharat   Add/Unskip tests ...
51
52
53
54
    url:    https://github.com/user/repo
    dir:    /
    is a:   plugin
    clone?: true
fe44337cb   Shrikant Sharat   Add test file for...
55
56
57
58
  
  Short repo with location.
  
    $ b user/plugin path/to/plugin
889cc93f9   Shrikant Sharat   Add/Unskip tests ...
59
60
61
62
    url:    https://github.com/user/plugin.git
    dir:    path/to/plugin
    is a:   plugin
    clone?: true
fe44337cb   Shrikant Sharat   Add test file for...
63

fe44337cb   Shrikant Sharat   Add test file for...
64
  Keyword arguments, in respective places.
968db0671   Shrikant Sharat   Trying to get tes...
65
    $ b --url=user/repo --loc=path/of/plugin
889cc93f9   Shrikant Sharat   Add/Unskip tests ...
66
67
68
69
    url:    https://github.com/user/repo.git
    dir:    path/of/plugin
    is a:   plugin
    clone?: true
fe44337cb   Shrikant Sharat   Add test file for...
70
71
  
  Keyword arguments, in respective places, with full repo url.
968db0671   Shrikant Sharat   Trying to get tes...
72
    $ b --url=https://github.com/user/repo.git --loc=plugin/path
889cc93f9   Shrikant Sharat   Add/Unskip tests ...
73
74
75
76
    url:    https://github.com/user/repo.git
    dir:    plugin/path
    is a:   plugin
    clone?: true
fe44337cb   Shrikant Sharat   Add test file for...
77
78
  
  Keyword arguments, in reversed order.
968db0671   Shrikant Sharat   Trying to get tes...
79
    $ b --loc=path/of/plugin --url=user/repo
889cc93f9   Shrikant Sharat   Add/Unskip tests ...
80
81
82
83
    url:    https://github.com/user/repo.git
    dir:    path/of/plugin
    is a:   plugin
    clone?: true
fe44337cb   Shrikant Sharat   Add test file for...
84
85
  
  Mixed positional and keyword arguments, and skip `loc`.
968db0671   Shrikant Sharat   Trying to get tes...
86
    $ b user/repo --loc=plugin/loc
889cc93f9   Shrikant Sharat   Add/Unskip tests ...
87
88
89
90
    url:    https://github.com/user/repo.git
    dir:    plugin/loc
    is a:   plugin
    clone?: true
fe44337cb   Shrikant Sharat   Add test file for...
91
92
93
94
  
  Just `loc`, using keyword arguments.
  
    $ b --loc=plugin/path
889cc93f9   Shrikant Sharat   Add/Unskip tests ...
95
96
97
98
    url:    https://github.com/gh-user/repo.git
    dir:    plugin/path
    is a:   plugin
    clone?: true
fe44337cb   Shrikant Sharat   Add test file for...
99

02f4901c5   Shrikant Sharat   Tests for all val...
100
  TODO: Error reporting with erroneous arguments or usage with incorrect syntax.