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.
Files changed (67) hide show
  1. data/.gitignore +1 -0
  2. data/.travis.yml +0 -2
  3. data/CHANGELOG.md +14 -0
  4. data/Gemfile.lock +9 -3
  5. data/README.md +68 -48
  6. data/Rakefile +47 -1
  7. data/bin/gcli +18 -0
  8. data/bin/ghc +1 -17
  9. data/features/blob.feature +6 -6
  10. data/features/collaborator.feature +10 -10
  11. data/features/commit.feature +6 -6
  12. data/features/completion.feature +3 -3
  13. data/features/config.feature +55 -0
  14. data/features/content.feature +9 -9
  15. data/features/download.feature +11 -11
  16. data/features/email.feature +8 -8
  17. data/features/errors.feature +11 -9
  18. data/features/event.feature +20 -20
  19. data/features/executable.feature +4 -4
  20. data/features/follower.feature +13 -13
  21. data/features/fork.feature +6 -6
  22. data/features/gist.feature +22 -22
  23. data/features/hook.feature +14 -14
  24. data/features/init.feature +48 -0
  25. data/features/issue.feature +12 -12
  26. data/features/key.feature +12 -12
  27. data/features/label.feature +23 -23
  28. data/features/member.feature +13 -13
  29. data/features/milestone.feature +12 -12
  30. data/features/organization.feature +9 -9
  31. data/features/pull_request.feature +18 -18
  32. data/features/reference.feature +13 -13
  33. data/features/repository.feature +20 -20
  34. data/features/search.feature +10 -10
  35. data/features/search_commands.feature +4 -4
  36. data/features/support/hooks.rb +3 -1
  37. data/features/tag.feature +6 -6
  38. data/features/team.feature +28 -28
  39. data/features/tree.feature +5 -5
  40. data/features/usage.feature +3 -3
  41. data/features/user.feature +7 -7
  42. data/features/watching.feature +13 -13
  43. data/fixtures/simple_config +9 -8
  44. data/github_cli.gemspec +2 -2
  45. data/lib/github_cli/api.rb +3 -3
  46. data/lib/github_cli/cli.rb +96 -17
  47. data/lib/github_cli/config.rb +30 -9
  48. data/lib/github_cli/editor.rb +11 -6
  49. data/lib/github_cli/man/gcli-config.1 +102 -0
  50. data/lib/github_cli/man/gcli-config.1.txt +96 -0
  51. data/lib/github_cli/man/gcli-repo.1 +16 -0
  52. data/lib/github_cli/man/gcli-repo.1.txt +15 -0
  53. data/lib/github_cli/man/gcli.1 +34 -0
  54. data/lib/github_cli/man/gcli.1.txt +33 -0
  55. data/lib/github_cli/manpage.rb +42 -0
  56. data/lib/github_cli/pager.rb +1 -1
  57. data/lib/github_cli/terminal.rb +8 -2
  58. data/lib/github_cli/thor_ext.rb +12 -1
  59. data/lib/github_cli/vendor.rb +10 -0
  60. data/lib/github_cli/version.rb +1 -1
  61. data/lib/github_cli.rb +7 -2
  62. data/man/gcli-config.1.ronn +82 -0
  63. data/man/gcli-repo.1.ronn +7 -0
  64. data/man/gcli.1.ronn +29 -0
  65. data/spec/github_cli/config_spec.rb +21 -7
  66. metadata +43 -22
  67. data/features/settings.feature +0 -35
@@ -1,21 +1,21 @@
1
- Feature: ghc download
1
+ Feature: gcli download
2
2
 
3
3
  Scenario: Available commands
4
4
 
5
- When I run `ghc download`
5
+ When I run `gcli download`
6
6
  Then the exit status should be 0
7
- And the output should contain "ghc download create"
8
- And the output should contain "ghc download delete"
9
- And the output should contain "ghc download get"
10
- And the output should contain "ghc download list"
11
- And the output should contain "ghc download upload"
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 `ghc download ls wycats thor`
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 `ghc download get wycats thor 1`
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 `ghc download delete wycats thor 1`
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 `ghc download create wycats thor --params=name:octo.jpg size:113410`
42
+ When I run `gcli download create wycats thor --params=name:octo.jpg size:113410`
43
43
  Then the exit status should be 0
@@ -1,19 +1,19 @@
1
- Feature: ghc email
1
+ Feature: gcli email
2
2
 
3
3
  Scenario: Available commands
4
4
 
5
- When I run `ghc email`
5
+ When I run `gcli email`
6
6
  Then the exit status should be 0
7
- And the output should contain "ghc email delete"
8
- And the output should contain "ghc email list"
9
- And the output should contain "ghc email add"
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 `ghc email ls`
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 `ghc email add user@github.com`
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 `ghc email del user@github.com`
32
+ When I run `gcli email del user@github.com`
33
33
  Then the exit status should be 0
@@ -1,11 +1,13 @@
1
- Feature: ghc errors notification
1
+ Feature: gcli errors notification
2
2
 
3
- @wip
4
3
  Scenario: Unknown formatting option
5
-
6
- # When I run `ghc repo list -u wycats --format=unknown`
7
- # Then the exit status should be 1
8
- # And the output should contain:
9
- # """
10
- # Fatal error has occurred. Unrecognized formatting options: unknown
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
+ """
@@ -1,24 +1,24 @@
1
- Feature: ghc event
1
+ Feature: gcli event
2
2
 
3
3
  Scenario: Available commands
4
4
 
5
- When I run `ghc event`
5
+ When I run `gcli event`
6
6
  Then the exit status should be 0
7
- And the output should contain "ghc event issue"
8
- And the output should contain "ghc event network"
9
- And the output should contain "ghc event org"
10
- And the output should contain "ghc event performed"
11
- And the output should contain "ghc event public"
12
- And the output should contain "ghc event received"
13
- And the output should contain "ghc event repo"
14
- And the output should contain "ghc event user_org"
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 `ghc event public`
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 `ghc event repo wycats thor`
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 `ghc event issue wycats thor`
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 `ghc event network wycats thor`
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 `ghc event org github`
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 `ghc event received wycats`
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 `ghc event received wycats --public`
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 `ghc event performed wycats`
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 `ghc event performed wycats --public`
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 `ghc event user_org wycats rails`
93
+ When I run `gcli event user_org wycats rails`
94
94
  Then the exit status should be 0
@@ -7,11 +7,11 @@ Feature: The GHC Executable
7
7
 
8
8
  Scenario Outline: Getting Help for Commands
9
9
 
10
- When I run `ghc <cmd>`
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
- ghc help <command>
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 `ghc <command>`
23
+ When I run `gcli <command>`
24
24
  Then the exit status should be 0
25
- And the output should contain "ghc <command>"
25
+ And the output should contain "gcli <command>"
26
26
 
27
27
  Examples:
28
28
  | command |
@@ -1,21 +1,21 @@
1
- Feature: ghc follower
1
+ Feature: gcli follower
2
2
 
3
3
  Scenario: Available commands
4
4
 
5
- When I run `ghc follower`
5
+ When I run `gcli follower`
6
6
  Then the exit status should be 0
7
- And the output should contain "ghc follower follow"
8
- And the output should contain "ghc follower follower"
9
- And the output should contain "ghc follower following"
10
- And the output should contain "ghc follower list"
11
- And the output should contain "ghc follower unfollow"
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 `ghc follower ls -u wycats`
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 `ghc follower ls`
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 `ghc follower follower wycats`
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 `ghc follower following -u wycats`
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 `ghc follower follow wycats`
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 `ghc follower unfollow wycats`
58
+ When I run `gcli follower unfollow wycats`
59
59
  Then the exit status should be 0
@@ -1,18 +1,18 @@
1
- Feature: ghc fork
1
+ Feature: gcli fork
2
2
 
3
3
  Scenario: Available commands
4
4
 
5
- When I run `ghc fork`
5
+ When I run `gcli fork`
6
6
  Then the exit status should be 0
7
- And the output should contain "ghc fork create"
8
- And the output should contain "ghc fork list"
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 `ghc fork ls wycats thor`
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 `ghc fork create wycats thor`
23
+ When I run `gcli fork create wycats thor`
24
24
  Then the exit status should be 0
@@ -1,25 +1,25 @@
1
- Feature: ghc gist
1
+ Feature: gcli gist
2
2
 
3
3
  Scenario: Available commands
4
4
 
5
- When I run `ghc gist`
5
+ When I run `gcli gist`
6
6
  Then the exit status should be 0
7
- And the output should contain "ghc gist create"
8
- And the output should contain "ghc gist delete"
9
- And the output should contain "ghc gist edit"
10
- And the output should contain "ghc gist get"
11
- And the output should contain "ghc gist fork"
12
- And the output should contain "ghc gist list"
13
- And the output should contain "ghc gist star"
14
- And the output should contain "ghc gist starred"
15
- And the output should contain "ghc gist unstar"
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 `ghc gist ls -u wycats`
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 `ghc gist ls --starred`
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 `ghc gist ls`
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 `ghc gist get 1`
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 `ghc gist create --params=description:'desc' public:true files:'file' content:'string'`
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 `ghc gist edit`
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 `ghc gist star 1`
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 `ghc gist unstar 1`
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 `ghc gist starred 1`
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 `ghc gist fork 1`
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 `ghc gist del 1`
102
+ When I run `gcli gist del 1`
103
103
  Then the exit status should be 0
@@ -1,22 +1,22 @@
1
- Feature: ghc hook
1
+ Feature: gcli hook
2
2
 
3
3
  Scenario: Available commands
4
4
 
5
- When I run `ghc hook`
5
+ When I run `gcli hook`
6
6
  Then the exit status should be 0
7
- And the output should contain "ghc hook create"
8
- And the output should contain "ghc hook delete"
9
- And the output should contain "ghc hook edit"
10
- And the output should contain "ghc hook get"
11
- And the output should contain "ghc hook list"
12
- And the output should contain "ghc hook test"
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 `ghc hook ls wycats thor`
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 `ghc hook get wycats thor 1`
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 `ghc hook create wycats thor --params=name:web config:{}`
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 `ghc hook edit wycats thor 1 --params=name:web config:{}`
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 `ghc hook test wycats thor 1`
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 `ghc hook del wycats thor 1`
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
+ """
@@ -1,20 +1,20 @@
1
- Feature: ghc issue
1
+ Feature: gcli issue
2
2
 
3
3
  Scenario: Available commands
4
- When I run `ghc issue`
4
+ When I run `gcli issue`
5
5
  Then the exit status should be 0
6
- And the output should contain "ghc issue create"
7
- And the output should contain "ghc issue edit"
8
- And the output should contain "ghc issue get"
9
- And the output should contain "ghc issue list"
10
- And the output should contain "ghc issue repo"
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 `ghc issue ls`
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 `ghc issue repo wycats thor`
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 `ghc issue get wycats thor 1`
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 `ghc issue create wycats thor --params=title:'Found a bug'`
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 `ghc issue edit wycats thor 1 --params=title:'Found a bug'`
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