github_cli 0.4.4 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/.travis.yml +0 -2
- data/CHANGELOG.md +14 -0
- data/Gemfile.lock +9 -3
- data/README.md +68 -48
- data/Rakefile +47 -1
- data/bin/gcli +18 -0
- data/bin/ghc +1 -17
- data/features/blob.feature +6 -6
- data/features/collaborator.feature +10 -10
- data/features/commit.feature +6 -6
- data/features/completion.feature +3 -3
- data/features/config.feature +55 -0
- data/features/content.feature +9 -9
- data/features/download.feature +11 -11
- data/features/email.feature +8 -8
- data/features/errors.feature +11 -9
- data/features/event.feature +20 -20
- data/features/executable.feature +4 -4
- data/features/follower.feature +13 -13
- data/features/fork.feature +6 -6
- data/features/gist.feature +22 -22
- data/features/hook.feature +14 -14
- data/features/init.feature +48 -0
- data/features/issue.feature +12 -12
- data/features/key.feature +12 -12
- data/features/label.feature +23 -23
- data/features/member.feature +13 -13
- data/features/milestone.feature +12 -12
- data/features/organization.feature +9 -9
- data/features/pull_request.feature +18 -18
- data/features/reference.feature +13 -13
- data/features/repository.feature +20 -20
- data/features/search.feature +10 -10
- data/features/search_commands.feature +4 -4
- data/features/support/hooks.rb +3 -1
- data/features/tag.feature +6 -6
- data/features/team.feature +28 -28
- data/features/tree.feature +5 -5
- data/features/usage.feature +3 -3
- data/features/user.feature +7 -7
- data/features/watching.feature +13 -13
- data/fixtures/simple_config +9 -8
- data/github_cli.gemspec +2 -2
- data/lib/github_cli/api.rb +3 -3
- data/lib/github_cli/cli.rb +96 -17
- data/lib/github_cli/config.rb +30 -9
- data/lib/github_cli/editor.rb +11 -6
- data/lib/github_cli/man/gcli-config.1 +102 -0
- data/lib/github_cli/man/gcli-config.1.txt +96 -0
- data/lib/github_cli/man/gcli-repo.1 +16 -0
- data/lib/github_cli/man/gcli-repo.1.txt +15 -0
- data/lib/github_cli/man/gcli.1 +34 -0
- data/lib/github_cli/man/gcli.1.txt +33 -0
- data/lib/github_cli/manpage.rb +42 -0
- data/lib/github_cli/pager.rb +1 -1
- data/lib/github_cli/terminal.rb +8 -2
- data/lib/github_cli/thor_ext.rb +12 -1
- data/lib/github_cli/vendor.rb +10 -0
- data/lib/github_cli/version.rb +1 -1
- data/lib/github_cli.rb +7 -2
- data/man/gcli-config.1.ronn +82 -0
- data/man/gcli-repo.1.ronn +7 -0
- data/man/gcli.1.ronn +29 -0
- data/spec/github_cli/config_spec.rb +21 -7
- metadata +43 -22
- data/features/settings.feature +0 -35
data/features/download.feature
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
Feature:
|
1
|
+
Feature: gcli download
|
2
2
|
|
3
3
|
Scenario: Available commands
|
4
4
|
|
5
|
-
When I run `
|
5
|
+
When I run `gcli download`
|
6
6
|
Then the exit status should be 0
|
7
|
-
And the output should contain "
|
8
|
-
And the output should contain "
|
9
|
-
And the output should contain "
|
10
|
-
And the output should contain "
|
11
|
-
And the output should contain "
|
7
|
+
And the output should contain "gcli download create"
|
8
|
+
And the output should contain "gcli download delete"
|
9
|
+
And the output should contain "gcli download get"
|
10
|
+
And the output should contain "gcli download list"
|
11
|
+
And the output should contain "gcli download upload"
|
12
12
|
|
13
13
|
Scenario: List downloads
|
14
14
|
Given the GitHub API server:
|
15
15
|
"""
|
16
16
|
get('/repos/wycats/thor/downloads') { status 200 }
|
17
17
|
"""
|
18
|
-
When I run `
|
18
|
+
When I run `gcli download ls wycats thor`
|
19
19
|
Then the exit status should be 0
|
20
20
|
|
21
21
|
Scenario: Get download
|
@@ -23,7 +23,7 @@ Feature: ghc download
|
|
23
23
|
"""
|
24
24
|
get('/repos/wycats/thor/downloads/1') { status 200 }
|
25
25
|
"""
|
26
|
-
When I run `
|
26
|
+
When I run `gcli download get wycats thor 1`
|
27
27
|
Then the exit status should be 0
|
28
28
|
|
29
29
|
Scenario: Delete download
|
@@ -31,7 +31,7 @@ Feature: ghc download
|
|
31
31
|
"""
|
32
32
|
delete('/repos/wycats/thor/downloads/1') { status 200 }
|
33
33
|
"""
|
34
|
-
When I run `
|
34
|
+
When I run `gcli download delete wycats thor 1`
|
35
35
|
Then the exit status should be 0
|
36
36
|
|
37
37
|
Scenario: Create download
|
@@ -39,5 +39,5 @@ Feature: ghc download
|
|
39
39
|
"""
|
40
40
|
post('/repos/wycats/thor/downloads') { status 200 }
|
41
41
|
"""
|
42
|
-
When I run `
|
42
|
+
When I run `gcli download create wycats thor --params=name:octo.jpg size:113410`
|
43
43
|
Then the exit status should be 0
|
data/features/email.feature
CHANGED
@@ -1,19 +1,19 @@
|
|
1
|
-
Feature:
|
1
|
+
Feature: gcli email
|
2
2
|
|
3
3
|
Scenario: Available commands
|
4
4
|
|
5
|
-
When I run `
|
5
|
+
When I run `gcli email`
|
6
6
|
Then the exit status should be 0
|
7
|
-
And the output should contain "
|
8
|
-
And the output should contain "
|
9
|
-
And the output should contain "
|
7
|
+
And the output should contain "gcli email delete"
|
8
|
+
And the output should contain "gcli email list"
|
9
|
+
And the output should contain "gcli email add"
|
10
10
|
|
11
11
|
Scenario: List emails
|
12
12
|
Given the GitHub API server:
|
13
13
|
"""
|
14
14
|
get('/user/emails') { status 200 }
|
15
15
|
"""
|
16
|
-
When I run `
|
16
|
+
When I run `gcli email ls`
|
17
17
|
Then the exit status should be 0
|
18
18
|
|
19
19
|
Scenario: Add emails
|
@@ -21,7 +21,7 @@ Feature: ghc email
|
|
21
21
|
"""
|
22
22
|
post('/user/emails') { status 200 }
|
23
23
|
"""
|
24
|
-
When I run `
|
24
|
+
When I run `gcli email add user@github.com`
|
25
25
|
Then the exit status should be 0
|
26
26
|
|
27
27
|
Scenario: Delete emails
|
@@ -29,5 +29,5 @@ Feature: ghc email
|
|
29
29
|
"""
|
30
30
|
delete('/user/emails') { status 200 }
|
31
31
|
"""
|
32
|
-
When I run `
|
32
|
+
When I run `gcli email del user@github.com`
|
33
33
|
Then the exit status should be 0
|
data/features/errors.feature
CHANGED
@@ -1,11 +1,13 @@
|
|
1
|
-
Feature:
|
1
|
+
Feature: gcli errors notification
|
2
2
|
|
3
|
-
@wip
|
4
3
|
Scenario: Unknown formatting option
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
4
|
+
Given the GitHub API server:
|
5
|
+
"""
|
6
|
+
get('/users/wycats/repos') { status 200 }
|
7
|
+
"""
|
8
|
+
When I run `gcli repo ls -u wycats --format=unknown`
|
9
|
+
Then the exit status should be 1
|
10
|
+
And the output should contain:
|
11
|
+
"""
|
12
|
+
Fatal error has occurred. Unrecognized formatting options: unknown
|
13
|
+
"""
|
data/features/event.feature
CHANGED
@@ -1,24 +1,24 @@
|
|
1
|
-
Feature:
|
1
|
+
Feature: gcli event
|
2
2
|
|
3
3
|
Scenario: Available commands
|
4
4
|
|
5
|
-
When I run `
|
5
|
+
When I run `gcli event`
|
6
6
|
Then the exit status should be 0
|
7
|
-
And the output should contain "
|
8
|
-
And the output should contain "
|
9
|
-
And the output should contain "
|
10
|
-
And the output should contain "
|
11
|
-
And the output should contain "
|
12
|
-
And the output should contain "
|
13
|
-
And the output should contain "
|
14
|
-
And the output should contain "
|
7
|
+
And the output should contain "gcli event issue"
|
8
|
+
And the output should contain "gcli event network"
|
9
|
+
And the output should contain "gcli event org"
|
10
|
+
And the output should contain "gcli event performed"
|
11
|
+
And the output should contain "gcli event public"
|
12
|
+
And the output should contain "gcli event received"
|
13
|
+
And the output should contain "gcli event repo"
|
14
|
+
And the output should contain "gcli event user_org"
|
15
15
|
|
16
16
|
Scenario: Public events
|
17
17
|
Given the GitHub API server:
|
18
18
|
"""
|
19
19
|
get('/events') { status 200 }
|
20
20
|
"""
|
21
|
-
When I run `
|
21
|
+
When I run `gcli event public`
|
22
22
|
Then the exit status should be 0
|
23
23
|
|
24
24
|
Scenario: Repository events
|
@@ -26,7 +26,7 @@ Feature: ghc event
|
|
26
26
|
"""
|
27
27
|
get('/repos/wycats/thor/events') { status 200 }
|
28
28
|
"""
|
29
|
-
When I run `
|
29
|
+
When I run `gcli event repo wycats thor`
|
30
30
|
Then the exit status should be 0
|
31
31
|
|
32
32
|
Scenario: Issue events
|
@@ -34,7 +34,7 @@ Feature: ghc event
|
|
34
34
|
"""
|
35
35
|
get('/repos/wycats/thor/issues/events') { status 200 }
|
36
36
|
"""
|
37
|
-
When I run `
|
37
|
+
When I run `gcli event issue wycats thor`
|
38
38
|
Then the exit status should be 0
|
39
39
|
|
40
40
|
Scenario: Network events
|
@@ -42,7 +42,7 @@ Feature: ghc event
|
|
42
42
|
"""
|
43
43
|
get('/networks/wycats/thor/events') { status 200 }
|
44
44
|
"""
|
45
|
-
When I run `
|
45
|
+
When I run `gcli event network wycats thor`
|
46
46
|
Then the exit status should be 0
|
47
47
|
|
48
48
|
Scenario: Organization events
|
@@ -50,7 +50,7 @@ Feature: ghc event
|
|
50
50
|
"""
|
51
51
|
get('/orgs/github/events') { status 200 }
|
52
52
|
"""
|
53
|
-
When I run `
|
53
|
+
When I run `gcli event org github`
|
54
54
|
Then the exit status should be 0
|
55
55
|
|
56
56
|
Scenario: Received events
|
@@ -58,7 +58,7 @@ Feature: ghc event
|
|
58
58
|
"""
|
59
59
|
get('/users/wycats/received_events') { status 200 }
|
60
60
|
"""
|
61
|
-
When I run `
|
61
|
+
When I run `gcli event received wycats`
|
62
62
|
Then the exit status should be 0
|
63
63
|
|
64
64
|
Scenario: Received public events
|
@@ -66,7 +66,7 @@ Feature: ghc event
|
|
66
66
|
"""
|
67
67
|
get('/users/wycats/received_events/public') { status 200 }
|
68
68
|
"""
|
69
|
-
When I run `
|
69
|
+
When I run `gcli event received wycats --public`
|
70
70
|
Then the exit status should be 0
|
71
71
|
|
72
72
|
Scenario: Performed events
|
@@ -74,7 +74,7 @@ Feature: ghc event
|
|
74
74
|
"""
|
75
75
|
get('/users/wycats/events') { status 200 }
|
76
76
|
"""
|
77
|
-
When I run `
|
77
|
+
When I run `gcli event performed wycats`
|
78
78
|
Then the exit status should be 0
|
79
79
|
|
80
80
|
Scenario: Performed public events
|
@@ -82,7 +82,7 @@ Feature: ghc event
|
|
82
82
|
"""
|
83
83
|
get('/users/wycats/events/public') { status 200 }
|
84
84
|
"""
|
85
|
-
When I run `
|
85
|
+
When I run `gcli event performed wycats --public`
|
86
86
|
Then the exit status should be 0
|
87
87
|
|
88
88
|
Scenario: User organization events
|
@@ -90,5 +90,5 @@ Feature: ghc event
|
|
90
90
|
"""
|
91
91
|
get('/users/wycats/events/orgs/rails') { status 200 }
|
92
92
|
"""
|
93
|
-
When I run `
|
93
|
+
When I run `gcli event user_org wycats rails`
|
94
94
|
Then the exit status should be 0
|
data/features/executable.feature
CHANGED
@@ -7,11 +7,11 @@ Feature: The GHC Executable
|
|
7
7
|
|
8
8
|
Scenario Outline: Getting Help for Commands
|
9
9
|
|
10
|
-
When I run `
|
10
|
+
When I run `gcli <cmd>`
|
11
11
|
Then the exit status should be 0
|
12
12
|
And the output should contain:
|
13
13
|
"""
|
14
|
-
|
14
|
+
gcli help <command>
|
15
15
|
"""
|
16
16
|
Examples:
|
17
17
|
| cmd |
|
@@ -20,9 +20,9 @@ Feature: The GHC Executable
|
|
20
20
|
|
21
21
|
Scenario Outline: Getting Subcommands
|
22
22
|
|
23
|
-
When I run `
|
23
|
+
When I run `gcli <command>`
|
24
24
|
Then the exit status should be 0
|
25
|
-
And the output should contain "
|
25
|
+
And the output should contain "gcli <command>"
|
26
26
|
|
27
27
|
Examples:
|
28
28
|
| command |
|
data/features/follower.feature
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
Feature:
|
1
|
+
Feature: gcli follower
|
2
2
|
|
3
3
|
Scenario: Available commands
|
4
4
|
|
5
|
-
When I run `
|
5
|
+
When I run `gcli follower`
|
6
6
|
Then the exit status should be 0
|
7
|
-
And the output should contain "
|
8
|
-
And the output should contain "
|
9
|
-
And the output should contain "
|
10
|
-
And the output should contain "
|
11
|
-
And the output should contain "
|
7
|
+
And the output should contain "gcli follower follow"
|
8
|
+
And the output should contain "gcli follower follower"
|
9
|
+
And the output should contain "gcli follower following"
|
10
|
+
And the output should contain "gcli follower list"
|
11
|
+
And the output should contain "gcli follower unfollow"
|
12
12
|
|
13
13
|
Scenario: List for user
|
14
14
|
Given the GitHub API server:
|
15
15
|
"""
|
16
16
|
get('/users/wycats/followers') { status 200 }
|
17
17
|
"""
|
18
|
-
When I run `
|
18
|
+
When I run `gcli follower ls -u wycats`
|
19
19
|
Then the exit status should be 0
|
20
20
|
|
21
21
|
Scenario: List for the authenticated user
|
@@ -23,7 +23,7 @@ Feature: ghc follower
|
|
23
23
|
"""
|
24
24
|
get('/user/followers') { status 200 }
|
25
25
|
"""
|
26
|
-
When I run `
|
26
|
+
When I run `gcli follower ls`
|
27
27
|
Then the exit status should be 0
|
28
28
|
|
29
29
|
Scenario: Follower
|
@@ -31,7 +31,7 @@ Feature: ghc follower
|
|
31
31
|
"""
|
32
32
|
get('/users/following/wycats') { status 200 }
|
33
33
|
"""
|
34
|
-
When I run `
|
34
|
+
When I run `gcli follower follower wycats`
|
35
35
|
Then the exit status should be 0
|
36
36
|
|
37
37
|
Scenario: Following
|
@@ -39,7 +39,7 @@ Feature: ghc follower
|
|
39
39
|
"""
|
40
40
|
get('/users/wycats/following') { status 200 }
|
41
41
|
"""
|
42
|
-
When I run `
|
42
|
+
When I run `gcli follower following -u wycats`
|
43
43
|
Then the exit status should be 0
|
44
44
|
|
45
45
|
Scenario: Follow
|
@@ -47,7 +47,7 @@ Feature: ghc follower
|
|
47
47
|
"""
|
48
48
|
put('/user/following/wycats') { status 200 }
|
49
49
|
"""
|
50
|
-
When I run `
|
50
|
+
When I run `gcli follower follow wycats`
|
51
51
|
Then the exit status should be 0
|
52
52
|
|
53
53
|
Scenario: Unfollow
|
@@ -55,5 +55,5 @@ Feature: ghc follower
|
|
55
55
|
"""
|
56
56
|
delete('/user/following/wycats') { status 200 }
|
57
57
|
"""
|
58
|
-
When I run `
|
58
|
+
When I run `gcli follower unfollow wycats`
|
59
59
|
Then the exit status should be 0
|
data/features/fork.feature
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
Feature:
|
1
|
+
Feature: gcli fork
|
2
2
|
|
3
3
|
Scenario: Available commands
|
4
4
|
|
5
|
-
When I run `
|
5
|
+
When I run `gcli fork`
|
6
6
|
Then the exit status should be 0
|
7
|
-
And the output should contain "
|
8
|
-
And the output should contain "
|
7
|
+
And the output should contain "gcli fork create"
|
8
|
+
And the output should contain "gcli fork list"
|
9
9
|
|
10
10
|
Scenario: List forks
|
11
11
|
Given the GitHub API server:
|
12
12
|
"""
|
13
13
|
get('/repos/wycats/thor/forks') { status 200 }
|
14
14
|
"""
|
15
|
-
When I run `
|
15
|
+
When I run `gcli fork ls wycats thor`
|
16
16
|
Then the exit status should be 0
|
17
17
|
|
18
18
|
Scenario: Create fork
|
@@ -20,5 +20,5 @@ Feature: ghc fork
|
|
20
20
|
"""
|
21
21
|
post('/repos/wycats/thor/forks') { status 200 }
|
22
22
|
"""
|
23
|
-
When I run `
|
23
|
+
When I run `gcli fork create wycats thor`
|
24
24
|
Then the exit status should be 0
|
data/features/gist.feature
CHANGED
@@ -1,25 +1,25 @@
|
|
1
|
-
Feature:
|
1
|
+
Feature: gcli gist
|
2
2
|
|
3
3
|
Scenario: Available commands
|
4
4
|
|
5
|
-
When I run `
|
5
|
+
When I run `gcli gist`
|
6
6
|
Then the exit status should be 0
|
7
|
-
And the output should contain "
|
8
|
-
And the output should contain "
|
9
|
-
And the output should contain "
|
10
|
-
And the output should contain "
|
11
|
-
And the output should contain "
|
12
|
-
And the output should contain "
|
13
|
-
And the output should contain "
|
14
|
-
And the output should contain "
|
15
|
-
And the output should contain "
|
7
|
+
And the output should contain "gcli gist create"
|
8
|
+
And the output should contain "gcli gist delete"
|
9
|
+
And the output should contain "gcli gist edit"
|
10
|
+
And the output should contain "gcli gist get"
|
11
|
+
And the output should contain "gcli gist fork"
|
12
|
+
And the output should contain "gcli gist list"
|
13
|
+
And the output should contain "gcli gist star"
|
14
|
+
And the output should contain "gcli gist starred"
|
15
|
+
And the output should contain "gcli gist unstar"
|
16
16
|
|
17
17
|
Scenario: List gists for user
|
18
18
|
Given the GitHub API server:
|
19
19
|
"""
|
20
20
|
get('/users/wycats/gists') { status 200 }
|
21
21
|
"""
|
22
|
-
When I run `
|
22
|
+
When I run `gcli gist ls -u wycats`
|
23
23
|
Then the exit status should be 0
|
24
24
|
|
25
25
|
Scenario: List starred gists for the authenticated user
|
@@ -27,7 +27,7 @@ Feature: ghc gist
|
|
27
27
|
"""
|
28
28
|
get('/gists/starred') { status 200 }
|
29
29
|
"""
|
30
|
-
When I run `
|
30
|
+
When I run `gcli gist ls --starred`
|
31
31
|
Then the exit status should be 0
|
32
32
|
|
33
33
|
Scenario: List public gists for the authenticated user
|
@@ -35,7 +35,7 @@ Feature: ghc gist
|
|
35
35
|
"""
|
36
36
|
get('/gists/public') { status 200 }
|
37
37
|
"""
|
38
|
-
When I run `
|
38
|
+
When I run `gcli gist ls`
|
39
39
|
Then the exit status should be 0
|
40
40
|
|
41
41
|
Scenario: Get gist
|
@@ -43,7 +43,7 @@ Feature: ghc gist
|
|
43
43
|
"""
|
44
44
|
get('/gists/1') { status 200 }
|
45
45
|
"""
|
46
|
-
When I run `
|
46
|
+
When I run `gcli gist get 1`
|
47
47
|
Then the exit status should be 0
|
48
48
|
|
49
49
|
Scenario: Create gist
|
@@ -51,7 +51,7 @@ Feature: ghc gist
|
|
51
51
|
"""
|
52
52
|
post('/gists') { status 200 }
|
53
53
|
"""
|
54
|
-
When I run `
|
54
|
+
When I run `gcli gist create --params=description:'desc' public:true files:'file' content:'string'`
|
55
55
|
Then the exit status should be 0
|
56
56
|
|
57
57
|
Scenario: Edit gist
|
@@ -59,7 +59,7 @@ Feature: ghc gist
|
|
59
59
|
"""
|
60
60
|
patch('/gists/1') { status 200 }
|
61
61
|
"""
|
62
|
-
When I run `
|
62
|
+
When I run `gcli gist edit`
|
63
63
|
Then the exit status should be 0
|
64
64
|
|
65
65
|
Scenario: Star gist
|
@@ -67,7 +67,7 @@ Feature: ghc gist
|
|
67
67
|
"""
|
68
68
|
put('/gists/1/star') { status 200 }
|
69
69
|
"""
|
70
|
-
When I run `
|
70
|
+
When I run `gcli gist star 1`
|
71
71
|
Then the exit status should be 0
|
72
72
|
|
73
73
|
Scenario: Unstar gist
|
@@ -75,7 +75,7 @@ Feature: ghc gist
|
|
75
75
|
"""
|
76
76
|
delete('/gists/1/star') { status 200 }
|
77
77
|
"""
|
78
|
-
When I run `
|
78
|
+
When I run `gcli gist unstar 1`
|
79
79
|
Then the exit status should be 0
|
80
80
|
|
81
81
|
Scenario: Starred gist
|
@@ -83,7 +83,7 @@ Feature: ghc gist
|
|
83
83
|
"""
|
84
84
|
get('/gists/1/star') { status 200 }
|
85
85
|
"""
|
86
|
-
When I run `
|
86
|
+
When I run `gcli gist starred 1`
|
87
87
|
Then the exit status should be 0
|
88
88
|
|
89
89
|
Scenario: Fork gist
|
@@ -91,7 +91,7 @@ Feature: ghc gist
|
|
91
91
|
"""
|
92
92
|
post('/gists/1/fork') { status 200 }
|
93
93
|
"""
|
94
|
-
When I run `
|
94
|
+
When I run `gcli gist fork 1`
|
95
95
|
Then the exit status should be 0
|
96
96
|
|
97
97
|
Scenario: Delete gist
|
@@ -99,5 +99,5 @@ Feature: ghc gist
|
|
99
99
|
"""
|
100
100
|
delete('/gists/1') { status 200 }
|
101
101
|
"""
|
102
|
-
When I run `
|
102
|
+
When I run `gcli gist del 1`
|
103
103
|
Then the exit status should be 0
|
data/features/hook.feature
CHANGED
@@ -1,22 +1,22 @@
|
|
1
|
-
Feature:
|
1
|
+
Feature: gcli hook
|
2
2
|
|
3
3
|
Scenario: Available commands
|
4
4
|
|
5
|
-
When I run `
|
5
|
+
When I run `gcli hook`
|
6
6
|
Then the exit status should be 0
|
7
|
-
And the output should contain "
|
8
|
-
And the output should contain "
|
9
|
-
And the output should contain "
|
10
|
-
And the output should contain "
|
11
|
-
And the output should contain "
|
12
|
-
And the output should contain "
|
7
|
+
And the output should contain "gcli hook create"
|
8
|
+
And the output should contain "gcli hook delete"
|
9
|
+
And the output should contain "gcli hook edit"
|
10
|
+
And the output should contain "gcli hook get"
|
11
|
+
And the output should contain "gcli hook list"
|
12
|
+
And the output should contain "gcli hook test"
|
13
13
|
|
14
14
|
Scenario: List hooks
|
15
15
|
Given the GitHub API server:
|
16
16
|
"""
|
17
17
|
get('/repos/wycats/thor/hooks') { status 200 }
|
18
18
|
"""
|
19
|
-
When I run `
|
19
|
+
When I run `gcli hook ls wycats thor`
|
20
20
|
Then the exit status should be 0
|
21
21
|
|
22
22
|
Scenario: Get hook
|
@@ -24,7 +24,7 @@ Feature: ghc hook
|
|
24
24
|
"""
|
25
25
|
get('/repos/wycats/thor/hooks/1') { status 200 }
|
26
26
|
"""
|
27
|
-
When I run `
|
27
|
+
When I run `gcli hook get wycats thor 1`
|
28
28
|
Then the exit status should be 0
|
29
29
|
|
30
30
|
Scenario: Create hook
|
@@ -32,7 +32,7 @@ Feature: ghc hook
|
|
32
32
|
"""
|
33
33
|
post('/repos/wycats/thor/hooks') { status 200 }
|
34
34
|
"""
|
35
|
-
When I run `
|
35
|
+
When I run `gcli hook create wycats thor --params=name:web config:{}`
|
36
36
|
Then the exit status should be 0
|
37
37
|
|
38
38
|
Scenario: Edit hook
|
@@ -40,7 +40,7 @@ Feature: ghc hook
|
|
40
40
|
"""
|
41
41
|
patch('/repos/wycats/thor/hooks/1') { status 200 }
|
42
42
|
"""
|
43
|
-
When I run `
|
43
|
+
When I run `gcli hook edit wycats thor 1 --params=name:web config:{}`
|
44
44
|
Then the exit status should be 0
|
45
45
|
|
46
46
|
Scenario: Test hook
|
@@ -48,7 +48,7 @@ Feature: ghc hook
|
|
48
48
|
"""
|
49
49
|
post('/repos/wycats/thor/hooks/1/test') { status 200 }
|
50
50
|
"""
|
51
|
-
When I run `
|
51
|
+
When I run `gcli hook test wycats thor 1`
|
52
52
|
Then the exit status should be 0
|
53
53
|
|
54
54
|
Scenario: Delete hook
|
@@ -56,6 +56,6 @@ Feature: ghc hook
|
|
56
56
|
"""
|
57
57
|
delete('/repos/wycats/thor/hooks/1') { status 200 }
|
58
58
|
"""
|
59
|
-
When I run `
|
59
|
+
When I run `gcli hook del wycats thor 1`
|
60
60
|
Then the exit status should be 0
|
61
61
|
|
@@ -0,0 +1,48 @@
|
|
1
|
+
@settings
|
2
|
+
Feature: Init command
|
3
|
+
|
4
|
+
As a developer who wants to set global settings for interaction with GitHub API
|
5
|
+
When I use interface provided by GHC
|
6
|
+
I have ability to create configuration file
|
7
|
+
|
8
|
+
Scenario: Init requires scope
|
9
|
+
When I run `gcli init`
|
10
|
+
Then the output should contain:
|
11
|
+
"""
|
12
|
+
Invalid scope given. Please use --local or --global.
|
13
|
+
"""
|
14
|
+
|
15
|
+
Scenario: Installs global config file
|
16
|
+
When I run `gcli init --global` interactively
|
17
|
+
And I type "token"
|
18
|
+
Then the output should contain:
|
19
|
+
"""
|
20
|
+
Writing new configuration file to /tmp/fakehome/.githubrc
|
21
|
+
"""
|
22
|
+
And a file named "/tmp/fakehome/.githubrc" should exist
|
23
|
+
And the file "/tmp/fakehome/.githubrc" should contain "auth.token: token"
|
24
|
+
|
25
|
+
Scenario: Installs local config file
|
26
|
+
Given a directory named "piotr"
|
27
|
+
When I cd to "piotr"
|
28
|
+
And I run `gcli init --local` interactively
|
29
|
+
And I type "token"
|
30
|
+
Then a file named ".githubrc" should exist
|
31
|
+
And the file ".githubrc" should contain "auth.token: token"
|
32
|
+
|
33
|
+
Scenario: Global config file arleady exists
|
34
|
+
Given an empty file named "/tmp/fakehome/.githubrc"
|
35
|
+
When I run `gcli init --global`
|
36
|
+
Then the output should contain:
|
37
|
+
"""
|
38
|
+
Not overwritting existing config file /tmp/fakehome/.githubrc, use --force to override.
|
39
|
+
"""
|
40
|
+
|
41
|
+
Scenario: Force global config file override
|
42
|
+
Given an empty file named "/tmp/fakehome/.githubrc"
|
43
|
+
When I run `gcli init --global --force` interactively
|
44
|
+
And I type "token"
|
45
|
+
Then the output should contain:
|
46
|
+
"""
|
47
|
+
Please specify your GitHub Authentication Token (register on github.com to get it):
|
48
|
+
"""
|
data/features/issue.feature
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
Feature:
|
1
|
+
Feature: gcli issue
|
2
2
|
|
3
3
|
Scenario: Available commands
|
4
|
-
When I run `
|
4
|
+
When I run `gcli issue`
|
5
5
|
Then the exit status should be 0
|
6
|
-
And the output should contain "
|
7
|
-
And the output should contain "
|
8
|
-
And the output should contain "
|
9
|
-
And the output should contain "
|
10
|
-
And the output should contain "
|
6
|
+
And the output should contain "gcli issue create"
|
7
|
+
And the output should contain "gcli issue edit"
|
8
|
+
And the output should contain "gcli issue get"
|
9
|
+
And the output should contain "gcli issue list"
|
10
|
+
And the output should contain "gcli issue repo"
|
11
11
|
|
12
12
|
Scenario: List issues
|
13
13
|
Given the GitHub API server:
|
14
14
|
"""
|
15
15
|
get('/issues') { status 200 }
|
16
16
|
"""
|
17
|
-
When I run `
|
17
|
+
When I run `gcli issue ls`
|
18
18
|
Then the exit status should be 0
|
19
19
|
|
20
20
|
Scenario: List issues for a repository
|
@@ -22,7 +22,7 @@ Feature: ghc issue
|
|
22
22
|
"""
|
23
23
|
get('/repos/wycats/thor/issues') { status 200 }
|
24
24
|
"""
|
25
|
-
When I run `
|
25
|
+
When I run `gcli issue repo wycats thor`
|
26
26
|
Then the exit status should be 0
|
27
27
|
|
28
28
|
Scenario: Get issue
|
@@ -30,7 +30,7 @@ Feature: ghc issue
|
|
30
30
|
"""
|
31
31
|
get('/repos/wycats/thor/issues/1') { status 200 }
|
32
32
|
"""
|
33
|
-
When I run `
|
33
|
+
When I run `gcli issue get wycats thor 1`
|
34
34
|
Then the exit status should be 0
|
35
35
|
|
36
36
|
Scenario: Create issue
|
@@ -38,7 +38,7 @@ Feature: ghc issue
|
|
38
38
|
"""
|
39
39
|
post('/repos/wycats/thor/issues') { status 200 }
|
40
40
|
"""
|
41
|
-
When I run `
|
41
|
+
When I run `gcli issue create wycats thor --params=title:'Found a bug'`
|
42
42
|
Then the exit status should be 0
|
43
43
|
|
44
44
|
Scenario: Edit issue
|
@@ -46,6 +46,6 @@ Feature: ghc issue
|
|
46
46
|
"""
|
47
47
|
patch('/repos/wycats/thor/issues/1') { status 200 }
|
48
48
|
"""
|
49
|
-
When I run `
|
49
|
+
When I run `gcli issue edit wycats thor 1 --params=title:'Found a bug'`
|
50
50
|
Then the exit status should be 0
|
51
51
|
|