github_cli 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -3,13 +3,11 @@ before_install:
3
3
  matrix:
4
4
  allow_failures:
5
5
  - rvm: ruby-head
6
- - rvm: jruby-19mode
7
6
  - rvm: rbx-19mode
8
7
  rvm:
9
8
  - 1.9.2
10
9
  - 1.9.3
11
10
  - rbx-19mode
12
- - jruby-19mode
13
11
  - ruby-head
14
12
  branches:
15
13
  only: master
data/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ 0.4.4 (July 15, 2012)
2
+
3
+ * Fix bug with tree retrieval and add feature tests.
4
+ * Add repository, tag api commands feature tests.
5
+ * Fix bug with listing references and add feature tests.
6
+ * Fix bugs with pull requests api and add feature tests.
7
+ * Add watching, search api commands tests.
8
+ * Fix bug when adding team repository and add feature tests.
9
+ * Fix bug when editing organization and add feature tests.
10
+ * Fix bug with listing issue on a repository and add tests.
11
+ * Fix bug with updating milestone and add milestone api tests.
12
+ * Improve overal command interface with explicit names and parameters.
13
+
1
14
  0.4.3 (July 14, 2012)
2
15
 
3
16
  * Add communist gem dependency.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- github_cli (0.4.3)
4
+ github_cli (0.4.4)
5
5
  github_api (~> 0.6)
6
6
  thor
7
7
 
@@ -0,0 +1,51 @@
1
+ Feature: ghc issue
2
+
3
+ Scenario: Available commands
4
+ When I run `ghc issue`
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"
11
+
12
+ Scenario: List issues
13
+ Given the GitHub API server:
14
+ """
15
+ get('/issues') { status 200 }
16
+ """
17
+ When I run `ghc issue ls`
18
+ Then the exit status should be 0
19
+
20
+ Scenario: List issues for a repository
21
+ Given the GitHub API server:
22
+ """
23
+ get('/repos/wycats/thor/issues') { status 200 }
24
+ """
25
+ When I run `ghc issue repo wycats thor`
26
+ Then the exit status should be 0
27
+
28
+ Scenario: Get issue
29
+ Given the GitHub API server:
30
+ """
31
+ get('/repos/wycats/thor/issues/1') { status 200 }
32
+ """
33
+ When I run `ghc issue get wycats thor 1`
34
+ Then the exit status should be 0
35
+
36
+ Scenario: Create issue
37
+ Given the GitHub API server:
38
+ """
39
+ post('/repos/wycats/thor/issues') { status 200 }
40
+ """
41
+ When I run `ghc issue create wycats thor --params=title:'Found a bug'`
42
+ Then the exit status should be 0
43
+
44
+ Scenario: Edit issue
45
+ Given the GitHub API server:
46
+ """
47
+ patch('/repos/wycats/thor/issues/1') { status 200 }
48
+ """
49
+ When I run `ghc issue edit wycats thor 1 --params=title:'Found a bug'`
50
+ Then the exit status should be 0
51
+
@@ -0,0 +1,52 @@
1
+ Feature: ghc key
2
+
3
+ Scenario: Available commands
4
+
5
+ When I run `ghc key`
6
+ Then the exit status should be 0
7
+ And the output should contain "ghc key create"
8
+ And the output should contain "ghc key delete"
9
+ And the output should contain "ghc key edit"
10
+ And the output should contain "ghc key get"
11
+ And the output should contain "ghc key list"
12
+
13
+ Scenario: List keys
14
+ Given the GitHub API server:
15
+ """
16
+ get('/repos/wycats/thor/keys') { status 200 }
17
+ """
18
+ When I run `ghc key ls wycats thor`
19
+ Then the exit status should be 0
20
+
21
+ Scenario: Get key
22
+ Given the GitHub API server:
23
+ """
24
+ get('/repos/wycats/thor/keys/1') { status 200 }
25
+ """
26
+ When I run `ghc key get wycats thor 1`
27
+ Then the exit status should be 0
28
+
29
+ Scenario: Create key
30
+ Given the GitHub API server:
31
+ """
32
+ post('/repos/wycats/thor/keys') { status 200 }
33
+ """
34
+ When I run `ghc key create wycats thor --params=title:octo key:fh34d55`
35
+ Then the exit status should be 0
36
+
37
+ Scenario: Edit key
38
+ Given the GitHub API server:
39
+ """
40
+ patch('/repos/wycats/thor/keys/1') { status 200 }
41
+ """
42
+ When I run `ghc key edit wycats thor 1 --params=title:octo key:fh34d55`
43
+ Then the exit status should be 0
44
+
45
+ Scenario: Delete key
46
+ Given the GitHub API server:
47
+ """
48
+ delete('/repos/wycats/thor/keys/1') { status 200 }
49
+ """
50
+ When I run `ghc key del wycats thor 1`
51
+ Then the exit status should be 0
52
+
@@ -9,10 +9,59 @@ Feature: ghc member
9
9
  And the output should contain "ghc member member"
10
10
  And the output should contain "ghc member publicize"
11
11
 
12
- # Scenario: List an organization members
13
- # When I run `ghc member ls rails`
14
- # Then the exit status should be 0
15
- #
16
- # Scenario: List an organization public members
17
- # When I run `ghc member ls rails --public`
18
- # Then the exit status should be 0
12
+ Scenario: List members
13
+ Given the GitHub API server:
14
+ """
15
+ get('/orgs/rails/members') { status 200 }
16
+ """
17
+ When I run `ghc member ls rails`
18
+ Then the exit status should be 0
19
+
20
+ Scenario: List public members
21
+ Given the GitHub API server:
22
+ """
23
+ get('/orgs/rails/public_members') { status 200 }
24
+ """
25
+ When I run `ghc member ls --public rails`
26
+ Then the exit status should be 0
27
+
28
+ Scenario: Check if user is a member of an organization
29
+ Given the GitHub API server:
30
+ """
31
+ get('/orgs/rails/members/wycats') { status 200 }
32
+ """
33
+ When I run `ghc member member rails wycats`
34
+ Then the exit status should be 0
35
+
36
+ Scenario: Check if user is a public member of an organization
37
+ Given the GitHub API server:
38
+ """
39
+ get('/orgs/rails/public_members/wycats') { status 200 }
40
+ """
41
+ When I run `ghc member member --public rails wycats`
42
+ Then the exit status should be 0
43
+
44
+ Scenario: Remove a member
45
+ Given the GitHub API server:
46
+ """
47
+ delete('/orgs/rails/members/wycats') { status 200 }
48
+ """
49
+ When I run `ghc member del rails wycats`
50
+ Then the exit status should be 0
51
+
52
+ Scenario: Publicize user's membership
53
+ Given the GitHub API server:
54
+ """
55
+ put('/orgs/rails/public_members/wycats') { status 200 }
56
+ """
57
+ When I run `ghc member publicize rails wycats`
58
+ Then the exit status should be 0
59
+
60
+ Scenario: Conceal user's membership
61
+ Given the GitHub API server:
62
+ """
63
+ delete('/orgs/rails/public_members/wycats') { status 200 }
64
+ """
65
+ When I run `ghc member conceal rails wycats`
66
+ Then the exit status should be 0
67
+
@@ -9,3 +9,44 @@ Feature: ghc milestone
9
9
  And the output should contain "ghc milestone get"
10
10
  And the output should contain "ghc milestone list"
11
11
  And the output should contain "ghc milestone update"
12
+
13
+ Scenario: List milestones
14
+ Given the GitHub API server:
15
+ """
16
+ get('/repos/wycats/thor/milestones') { status 200 }
17
+ """
18
+ When I run `ghc milestone ls wycats thor`
19
+ Then the exit status should be 0
20
+
21
+ Scenario: Get milestone
22
+ Given the GitHub API server:
23
+ """
24
+ get('/repos/wycats/thor/milestones/1') { status 200 }
25
+ """
26
+ When I run `ghc milestone get wycats thor 1`
27
+ Then the exit status should be 0
28
+
29
+ Scenario: Create milestone
30
+ Given the GitHub API server:
31
+ """
32
+ post('/repos/wycats/thor/milestones') { status 200 }
33
+ """
34
+ When I run `ghc milestone create wycats thor --params=title:new`
35
+ Then the exit status should be 0
36
+
37
+ Scenario: Update milestone
38
+ Given the GitHub API server:
39
+ """
40
+ patch('/repos/wycats/thor/milestones/1') { status 200 }
41
+ """
42
+ When I run `ghc milestone update wycats thor 1 --params=title:new`
43
+ Then the exit status should be 0
44
+
45
+ Scenario: Delete milestone
46
+ Given the GitHub API server:
47
+ """
48
+ delete('/repos/wycats/thor/milestones/1') { status 200 }
49
+ """
50
+ When I run `ghc milestone del wycats thor 1`
51
+ Then the exit status should be 0
52
+
@@ -7,3 +7,35 @@ Feature: ghc org
7
7
  And the output should contain "ghc org edit"
8
8
  And the output should contain "ghc org list"
9
9
  And the output should contain "ghc org get"
10
+
11
+ Scenario: List public organizations for a user
12
+ Given the GitHub API server:
13
+ """
14
+ get('/users/wycats/orgs') { status 200 }
15
+ """
16
+ When I run `ghc org ls --user=wycats`
17
+ Then the exit status should be 0
18
+
19
+ Scenario: List public organizations for the authenticated user
20
+ Given the GitHub API server:
21
+ """
22
+ get('/user/orgs') { status 200 }
23
+ """
24
+ When I run `ghc org ls`
25
+ Then the exit status should be 0
26
+
27
+ Scenario: Get an organization
28
+ Given the GitHub API server:
29
+ """
30
+ get('/orgs/rails') { status 200 }
31
+ """
32
+ When I run `ghc org get rails`
33
+ Then the exit status should be 0
34
+
35
+ Scenario: Edit an organization
36
+ Given the GitHub API server:
37
+ """
38
+ patch('/orgs/rails') { status 200 }
39
+ """
40
+ When I run `ghc org edit rails --params=name:github company:GitHub email:support@github.com`
41
+ Then the exit status should be 0
@@ -12,3 +12,67 @@ Feature: ghc pull request
12
12
  And the output should contain "ghc pull merge"
13
13
  And the output should contain "ghc pull merged"
14
14
  And the output should contain "ghc pull update"
15
+
16
+ Scenario: List pull requests
17
+ Given the GitHub API server:
18
+ """
19
+ get('/repos/wycats/thor/pulls') { status 200 }
20
+ """
21
+ When I run `ghc pull ls wycats thor`
22
+ Then the exit status should be 0
23
+
24
+ Scenario: Get pull request
25
+ Given the GitHub API server:
26
+ """
27
+ get('/repos/wycats/thor/pulls/1') { status 200 }
28
+ """
29
+ When I run `ghc pull get wycats thor 1`
30
+ Then the exit status should be 0
31
+
32
+ Scenario: Create pull request
33
+ Given the GitHub API server:
34
+ """
35
+ post('/repos/wycats/thor/pulls') { status 200 }
36
+ """
37
+ When I run `ghc pull create wycats thor --params=title:'Amazing new feauture'`
38
+ Then the exit status should be 0
39
+
40
+ Scenario: Update pull request
41
+ Given the GitHub API server:
42
+ """
43
+ patch('/repos/wycats/thor/pulls/1') { status 200 }
44
+ """
45
+ When I run `ghc pull update wycats thor 1 --params=title:'Amazing update'`
46
+ Then the exit status should be 0
47
+
48
+ Scenario: Commits on pull request
49
+ Given the GitHub API server:
50
+ """
51
+ get('/repos/wycats/thor/pulls/1/commits') { status 200 }
52
+ """
53
+ When I run `ghc pull commits wycats thor 1`
54
+ Then the exit status should be 0
55
+
56
+ Scenario: Files on pull request
57
+ Given the GitHub API server:
58
+ """
59
+ get('/repos/wycats/thor/pulls/1/files') { status 200 }
60
+ """
61
+ When I run `ghc pull files wycats thor 1`
62
+ Then the exit status should be 0
63
+
64
+ Scenario: Check if pull request has been merged
65
+ Given the GitHub API server:
66
+ """
67
+ get('/repos/wycats/thor/pulls/1/merge') { status 200 }
68
+ """
69
+ When I run `ghc pull merged wycats thor 1`
70
+ Then the exit status should be 0
71
+
72
+ Scenario: Merge pull request
73
+ Given the GitHub API server:
74
+ """
75
+ put('/repos/wycats/thor/pulls/1/merge') { status 200 }
76
+ """
77
+ When I run `ghc pull merge wycats thor 1`
78
+ Then the exit status should be 0
@@ -9,3 +9,52 @@ Feature: ghc ref
9
9
  And the output should contain "ghc ref get"
10
10
  And the output should contain "ghc ref list"
11
11
  And the output should contain "ghc ref update"
12
+
13
+ Scenario: List all references
14
+ Given the GitHub API server:
15
+ """
16
+ get('/repos/wycats/thor/git/refs') { status 200 }
17
+ """
18
+ When I run `ghc ref list wycats thor`
19
+ Then the exit status should be 0
20
+
21
+ Scenario: List branch references
22
+ Given the GitHub API server:
23
+ """
24
+ get('/repos/wycats/thor/git/refs/7d1b31e') { status 200 }
25
+ """
26
+ When I run `ghc ref list wycats thor --ref=7d1b31e`
27
+ Then the exit status should be 0
28
+
29
+ Scenario: Get reference
30
+ Given the GitHub API server:
31
+ """
32
+ get('/repos/wycats/thor/git/refs/7d1b31e') { status 200 }
33
+ """
34
+ When I run `ghc ref list wycats thor 7d1b31e`
35
+ Then the exit status should be 0
36
+
37
+ Scenario: Create reference
38
+ Given the GitHub API server:
39
+ """
40
+ post('/repos/wycats/thor/git/refs') { status 200 }
41
+ """
42
+ When I run `ghc ref create wycats thor --params=ref:refs/heads/master sha:827efc6d5`
43
+ Then the exit status should be 0
44
+
45
+ Scenario: Update reference
46
+ Given the GitHub API server:
47
+ """
48
+ patch('/repos/wycats/thor/git/refs/7d1b31e') { status 200 }
49
+ """
50
+ When I run `ghc ref update wycats thor 7d1b31e --params=force:true sha:827efc6d5`
51
+ Then the exit status should be 0
52
+
53
+ Scenario: Delete reference
54
+ Given the GitHub API server:
55
+ """
56
+ delete('/repos/wycats/thor/git/refs/7d1b31e') { status 200 }
57
+ """
58
+ When I run `ghc ref delete wycats thor 7d1b31e --params=ref:refs/heads/master`
59
+ Then the exit status should be 0
60
+
@@ -0,0 +1,97 @@
1
+ Feature: gh repository
2
+
3
+ Scenario: Available commands
4
+ When I run `ghc repo`
5
+ Then the exit status should be 0
6
+ And the output should contain "ghc repo branches"
7
+ And the output should contain "ghc repo contribs"
8
+ And the output should contain "ghc repo create"
9
+ And the output should contain "ghc repo edit"
10
+ And the output should contain "ghc repo get"
11
+ And the output should contain "ghc repo list"
12
+ And the output should contain "ghc repo languages"
13
+ And the output should contain "ghc repo tags"
14
+ And the output should contain "ghc repo teams"
15
+
16
+ Scenario: List repositories
17
+ Given the GitHub API server:
18
+ """
19
+ get('/users/wycats/repos') { status 200 }
20
+ """
21
+ When I run `ghc repo ls -u wycats`
22
+ Then the exit status should be 0
23
+
24
+ Scenario: Get repository
25
+ Given the GitHub API server:
26
+ """
27
+ get('/repos/wycats/thor') { status 200 }
28
+ """
29
+ When I run `ghc repo get wycats thor`
30
+ Then the exit status should be 0
31
+
32
+ Scenario: List repository contributors
33
+ Given the GitHub API server:
34
+ """
35
+ get('/repos/wycats/thor/contributors') {
36
+ status 200
37
+ }
38
+ """
39
+ When I run `ghc repo contribs wycats thor`
40
+ Then the exit status should be 0
41
+
42
+ Scenario: List repository branches
43
+ Given the GitHub API server:
44
+ """
45
+ get('/repos/wycats/thor/branches') {
46
+ status 200
47
+ }
48
+ """
49
+ When I run `ghc repo branches wycats thor`
50
+ Then the exit status should be 0
51
+
52
+ Scenario: List repository languages
53
+ Given the GitHub API server:
54
+ """
55
+ get('/repos/wycats/thor/languages') {
56
+ status 200
57
+ }
58
+ """
59
+ When I run `ghc repo languages wycats thor`
60
+ Then the exit status should be 0
61
+
62
+ Scenario: List repository teams
63
+ Given the GitHub API server:
64
+ """
65
+ get('/repos/wycats/thor/teams') {
66
+ status 200
67
+ }
68
+ """
69
+ When I run `ghc repo teams wycats thor`
70
+ Then the exit status should be 0
71
+
72
+ Scenario: List repository tags
73
+ Given the GitHub API server:
74
+ """
75
+ get('/repos/wycats/thor/tags') {
76
+ status 200
77
+ }
78
+ """
79
+ When I run `ghc repo tags wycats thor`
80
+ Then the exit status should be 0
81
+
82
+ Scenario: Create repository
83
+ Given the GitHub API server:
84
+ """
85
+ post('/user/repos') { status 200 }
86
+ """
87
+ When I run `ghc repo create github`
88
+ Then the exit status should be 0
89
+
90
+ Scenario: Edit repository
91
+ Given the GitHub API server:
92
+ """
93
+ patch('/repos/wycats/thor') { status 200 }
94
+ """
95
+ When I run `ghc repo edit wycats thor --params=name:thor`
96
+ Then the exit status should be 0
97
+
@@ -8,3 +8,35 @@ Feature: ghc search
8
8
  And the output should contain "ghc search issue"
9
9
  And the output should contain "ghc search repo"
10
10
  And the output should contain "ghc search user"
11
+
12
+ Scenario: Search issues
13
+ Given the GitHub API server:
14
+ """
15
+ get('/legacy/issues/search/wycats/thor/open/shell') { status 200 }
16
+ """
17
+ When I run `ghc search issue wycats thor shell --state=open`
18
+ Then the exit status should be 0
19
+
20
+ Scenario: Search repositories
21
+ Given the GitHub API server:
22
+ """
23
+ get('/legacy/repos/search/shell') { status 200 }
24
+ """
25
+ When I run `ghc search repo shell`
26
+ Then the exit status should be 0
27
+
28
+ Scenario: Search users
29
+ Given the GitHub API server:
30
+ """
31
+ get('/legacy/user/search/wycats') { status 200 }
32
+ """
33
+ When I run `ghc search user wycats`
34
+ Then the exit status should be 0
35
+
36
+ Scenario: Search email
37
+ Given the GitHub API server:
38
+ """
39
+ get('/legacy/user/search/wycats') { status 200 }
40
+ """
41
+ When I run `ghc search user wycats`
42
+ Then the exit status should be 0
data/features/tag.feature CHANGED
@@ -6,3 +6,19 @@ Feature: ghc tag
6
6
  Then the exit status should be 0
7
7
  And the output should contain "ghc tag create"
8
8
  And the output should contain "ghc tag get"
9
+
10
+ Scenario: Get tag
11
+ Given the GitHub API server:
12
+ """
13
+ get('/repos/wycats/thor/git/tags/827efc6d5') { status 200 }
14
+ """
15
+ When I run `ghc tag get wycats thor 827efc6d5`
16
+ Then the exit status should be 0
17
+
18
+ Scenario: Create tag
19
+ Given the GitHub API server:
20
+ """
21
+ post('/repos/wycats/thor/git/tags') { status 200 }
22
+ """
23
+ When I run `ghc tag create wycats thor`
24
+ Then the exit status should be 0
@@ -16,3 +16,108 @@ Feature: ghc team
16
16
  And the output should contain "ghc team remove_member"
17
17
  And the output should contain "ghc team remove_repo"
18
18
  And the output should contain "ghc team repo"
19
+
20
+ Scenario: List all teams
21
+ Given the GitHub API server:
22
+ """
23
+ get('/orgs/rails/teams') { status 200 }
24
+ """
25
+ When I run `ghc team ls rails`
26
+ Then the exit status should be 0
27
+
28
+ Scenario: Get team
29
+ Given the GitHub API server:
30
+ """
31
+ get('/teams/rails') { status 200 }
32
+ """
33
+ When I run `ghc team get rails`
34
+ Then the exit status should be 0
35
+
36
+ Scenario: Create team
37
+ Given the GitHub API server:
38
+ """
39
+ post('/orgs/rails/teams') { status 200 }
40
+ """
41
+ When I run `ghc team create rails --params=name:'new team'`
42
+ Then the exit status should be 0
43
+
44
+ Scenario: Edit team
45
+ Given the GitHub API server:
46
+ """
47
+ patch('/teams/rails') { status 200 }
48
+ """
49
+ When I run `ghc team edit rails --params=name:'new team'`
50
+ Then the exit status should be 0
51
+
52
+ Scenario: Delete team
53
+ Given the GitHub API server:
54
+ """
55
+ delete('/teams/rails') { status 200 }
56
+ """
57
+ When I run `ghc team del rails`
58
+ Then the exit status should be 0
59
+
60
+ Scenario: List team members
61
+ Given the GitHub API server:
62
+ """
63
+ get('/teams/rails/members') { status 200 }
64
+ """
65
+ When I run `ghc team list_members rails`
66
+ Then the exit status should be 0
67
+
68
+ Scenario: Check is user is a team member
69
+ Given the GitHub API server:
70
+ """
71
+ get('/teams/rails/members/wycats') { status 200 }
72
+ """
73
+ When I run `ghc team member rails wycats`
74
+ Then the exit status should be 0
75
+
76
+ Scenario: Add a team member
77
+ Given the GitHub API server:
78
+ """
79
+ put('/teams/rails/members/wycats') { status 200 }
80
+ """
81
+ When I run `ghc team add_member rails wycats`
82
+ Then the exit status should be 0
83
+
84
+ Scenario: Remove a team member
85
+ Given the GitHub API server:
86
+ """
87
+ delete('/teams/rails/members/wycats') { status 200 }
88
+ """
89
+ When I run `ghc team remove_member rails wycats`
90
+ Then the exit status should be 0
91
+
92
+ Scenario: List team repositories
93
+ Given the GitHub API server:
94
+ """
95
+ get('/teams/rails/repos') { status 200 }
96
+ """
97
+ When I run `ghc team list_repo rails`
98
+ Then the exit status should be 0
99
+
100
+ Scenario: Check if repository belongs to a team
101
+ Given the GitHub API server:
102
+ """
103
+ get('/teams/rails/repos/wycats/thor') { status 200 }
104
+ """
105
+ When I run `ghc team repo rails wycats thor`
106
+ Then the exit status should be 0
107
+
108
+ Scenario: Add a team repository
109
+ Given the GitHub API server:
110
+ """
111
+ put('/teams/rails/repos/wycats/thor') { status 200 }
112
+ """
113
+ When I run `ghc team add_repo rails wycats thor`
114
+ Then the exit status should be 0
115
+
116
+ Scenario: Remove a team repository
117
+ Given the GitHub API server:
118
+ """
119
+ delete('/teams/rails/repos/wycats/thor') { status 200 }
120
+ """
121
+ When I run `ghc team remove_repo rails wycats thor`
122
+ Then the exit status should be 0
123
+