github_api 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. data/README.md +50 -5
  2. data/features/cassettes/git_data/commits/get.yml +69 -0
  3. data/features/git_data/commmits.feature +14 -0
  4. data/lib/github_api.rb +1 -0
  5. data/lib/github_api/activity/events.rb +42 -33
  6. data/lib/github_api/activity/notifications.rb +22 -22
  7. data/lib/github_api/activity/starring.rb +16 -21
  8. data/lib/github_api/activity/watching.rb +16 -19
  9. data/lib/github_api/api.rb +51 -8
  10. data/lib/github_api/arguments.rb +155 -0
  11. data/lib/github_api/authorizations.rb +19 -20
  12. data/lib/github_api/configuration.rb +5 -0
  13. data/lib/github_api/emojis.rb +3 -3
  14. data/lib/github_api/error/validations.rb +2 -2
  15. data/lib/github_api/gists.rb +32 -42
  16. data/lib/github_api/gists/comments.rb +21 -23
  17. data/lib/github_api/git_data/blobs.rb +13 -16
  18. data/lib/github_api/git_data/commits.rb +12 -10
  19. data/lib/github_api/git_data/references.rb +24 -28
  20. data/lib/github_api/git_data/tags.rb +9 -11
  21. data/lib/github_api/git_data/trees.rb +10 -13
  22. data/lib/github_api/gitignore.rb +4 -6
  23. data/lib/github_api/issues.rb +24 -32
  24. data/lib/github_api/issues/assignees.rb +11 -8
  25. data/lib/github_api/issues/comments.rb +21 -26
  26. data/lib/github_api/issues/events.rb +7 -9
  27. data/lib/github_api/issues/labels.rb +39 -53
  28. data/lib/github_api/issues/milestones.rb +26 -33
  29. data/lib/github_api/markdown.rb +5 -6
  30. data/lib/github_api/meta.rb +3 -3
  31. data/lib/github_api/orgs.rb +10 -11
  32. data/lib/github_api/orgs/members.rb +18 -20
  33. data/lib/github_api/orgs/teams.rb +54 -58
  34. data/lib/github_api/pull_requests.rb +40 -54
  35. data/lib/github_api/pull_requests/comments.rb +19 -26
  36. data/lib/github_api/repos.rb +146 -101
  37. data/lib/github_api/repos/collaborators.rb +29 -30
  38. data/lib/github_api/repos/comments.rb +20 -25
  39. data/lib/github_api/repos/commits.rb +12 -14
  40. data/lib/github_api/repos/contents.rb +22 -14
  41. data/lib/github_api/repos/downloads.rb +19 -23
  42. data/lib/github_api/repos/forks.rb +6 -11
  43. data/lib/github_api/repos/hooks.rb +25 -34
  44. data/lib/github_api/repos/keys.rb +25 -27
  45. data/lib/github_api/repos/merging.rb +7 -6
  46. data/lib/github_api/repos/pub_sub_hubbub.rb +14 -18
  47. data/lib/github_api/repos/statuses.rb +13 -14
  48. data/lib/github_api/say.rb +1 -3
  49. data/lib/github_api/search.rb +12 -21
  50. data/lib/github_api/users.rb +10 -9
  51. data/lib/github_api/users/emails.rb +11 -9
  52. data/lib/github_api/users/followers.rb +25 -23
  53. data/lib/github_api/users/keys.rb +27 -29
  54. data/lib/github_api/version.rb +1 -1
  55. data/spec/github/activity/events/org_spec.rb +6 -6
  56. data/spec/github/activity/events/performed_spec.rb +1 -1
  57. data/spec/github/activity/events/received_spec.rb +1 -1
  58. data/spec/github/activity/events/user_org_spec.rb +4 -2
  59. data/spec/github/activity/notifications/create_spec.rb +1 -1
  60. data/spec/github/activity/notifications/delete_spec.rb +1 -1
  61. data/spec/github/activity/notifications/get_spec.rb +1 -1
  62. data/spec/github/activity/notifications/subscribed_spec.rb +1 -1
  63. data/spec/github/activity/starring/list_spec.rb +2 -0
  64. data/spec/github/activity/starring/starring_spec.rb +1 -1
  65. data/spec/github/activity/watching/list_spec.rb +2 -0
  66. data/spec/github/activity/watching/watching_spec.rb +1 -3
  67. data/spec/github/api/set_spec.rb +18 -4
  68. data/spec/github/api/with_spec.rb +28 -0
  69. data/spec/github/api_spec.rb +11 -33
  70. data/spec/github/arguments/parse_spec.rb +68 -0
  71. data/spec/github/authorizations/delete_spec.rb +1 -1
  72. data/spec/github/authorizations/get_spec.rb +1 -1
  73. data/spec/github/error/validations_spec.rb +3 -3
  74. data/spec/github/gists/comments/list_spec.rb +1 -1
  75. data/spec/github/gists/delete_spec.rb +1 -1
  76. data/spec/github/gists/fork_spec.rb +1 -1
  77. data/spec/github/gists/get_spec.rb +1 -1
  78. data/spec/github/gists/is_starred_spec.rb +2 -0
  79. data/spec/github/gists/star_spec.rb +1 -1
  80. data/spec/github/gists/unstar_spec.rb +1 -1
  81. data/spec/github/git_data/blobs/create_spec.rb +2 -0
  82. data/spec/github/git_data/blobs/get_spec.rb +1 -1
  83. data/spec/github/git_data/commits/create_spec.rb +2 -0
  84. data/spec/github/git_data/commits/get_spec.rb +3 -3
  85. data/spec/github/git_data/references/create_spec.rb +1 -1
  86. data/spec/github/git_data/references/delete_spec.rb +3 -1
  87. data/spec/github/git_data/tags/create_spec.rb +2 -0
  88. data/spec/github/gitignore/get_spec.rb +1 -1
  89. data/spec/github/issues/events/get_spec.rb +3 -1
  90. data/spec/github/issues/events/list_spec.rb +3 -1
  91. data/spec/github/issues/labels/add_spec.rb +6 -6
  92. data/spec/github/issues/labels/list_spec.rb +3 -1
  93. data/spec/github/issues/labels/replace_spec.rb +6 -7
  94. data/spec/github/issues/milestones/get_spec.rb +2 -0
  95. data/spec/github/normalizer_spec.rb +18 -6
  96. data/spec/github/orgs/members/conceal_spec.rb +6 -4
  97. data/spec/github/orgs/members/delete_spec.rb +2 -0
  98. data/spec/github/orgs/members/list_spec.rb +1 -1
  99. data/spec/github/orgs/members/member_spec.rb +3 -1
  100. data/spec/github/orgs/members/publicize_spec.rb +2 -0
  101. data/spec/github/orgs/teams/add_member_spec.rb +2 -0
  102. data/spec/github/orgs/teams/create_spec.rb +1 -1
  103. data/spec/github/orgs/teams/delete_spec.rb +1 -1
  104. data/spec/github/orgs/teams/edit_spec.rb +1 -1
  105. data/spec/github/orgs/teams/get_spec.rb +1 -1
  106. data/spec/github/orgs/teams/list_spec.rb +1 -1
  107. data/spec/github/orgs/teams/team_member_spec.rb +3 -1
  108. data/spec/github/parameter_filter_spec.rb +19 -58
  109. data/spec/github/pull_requests/comments/create_spec.rb +3 -1
  110. data/spec/github/pull_requests/comments/delete_spec.rb +1 -1
  111. data/spec/github/pull_requests/comments/edit_spec.rb +2 -0
  112. data/spec/github/pull_requests/comments/get_spec.rb +3 -1
  113. data/spec/github/pull_requests/comments/list_spec.rb +3 -1
  114. data/spec/github/pull_requests/commits_spec.rb +3 -3
  115. data/spec/github/pull_requests/create_spec.rb +4 -0
  116. data/spec/github/pull_requests/files_spec.rb +4 -0
  117. data/spec/github/pull_requests/get_spec.rb +3 -3
  118. data/spec/github/pull_requests/list_spec.rb +3 -3
  119. data/spec/github/pull_requests/merge_spec.rb +2 -0
  120. data/spec/github/pull_requests/merged_spec.rb +3 -1
  121. data/spec/github/pull_requests/update_spec.rb +4 -0
  122. data/spec/github/repos/collaborators/add_spec.rb +3 -1
  123. data/spec/github/repos/collaborators/get_spec.rb +1 -3
  124. data/spec/github/repos/collaborators/list_spec.rb +5 -1
  125. data/spec/github/repos/collaborators/remove_spec.rb +3 -1
  126. data/spec/github/repos/comments/create_spec.rb +4 -0
  127. data/spec/github/repos/comments/delete_spec.rb +2 -2
  128. data/spec/github/repos/comments/get_spec.rb +6 -2
  129. data/spec/github/repos/commits/compare_spec.rb +3 -3
  130. data/spec/github/repos/commits/get_spec.rb +3 -3
  131. data/spec/github/repos/commits/list_spec.rb +3 -3
  132. data/spec/github/repos/contents/archive_spec.rb +12 -0
  133. data/spec/github/repos/contents/get_spec.rb +5 -0
  134. data/spec/github/repos/contributors_spec.rb +7 -2
  135. data/spec/github/repos/downloads/create_spec.rb +4 -0
  136. data/spec/github/repos/downloads/delete_spec.rb +5 -1
  137. data/spec/github/repos/downloads/get_spec.rb +3 -1
  138. data/spec/github/repos/downloads/list_spec.rb +3 -1
  139. data/spec/github/repos/forks/create_spec.rb +2 -0
  140. data/spec/github/repos/forks/list_spec.rb +3 -1
  141. data/spec/github/repos/hooks/edit_spec.rb +1 -1
  142. data/spec/github/repos/keys/delete_spec.rb +1 -1
  143. data/spec/github/repos/keys/edit_spec.rb +2 -0
  144. data/spec/github/repos/keys/get_spec.rb +3 -1
  145. data/spec/github/repos/keys/list_spec.rb +4 -2
  146. data/spec/github/repos/list_spec.rb +6 -1
  147. data/spec/github/repos/pub_sub_hubbub/subscribe_service_spec.rb +27 -0
  148. data/spec/github/repos/pub_sub_hubbub/subscribe_spec.rb +51 -0
  149. data/spec/github/repos/pub_sub_hubbub/unsubscribe_service_spec.rb +21 -0
  150. data/spec/github/repos/pub_sub_hubbub/unsubscribe_spec.rb +58 -0
  151. data/spec/github/repos/statuses/create_spec.rb +2 -0
  152. data/spec/github/search_spec.rb +25 -10
  153. data/spec/github/users/followers/follow_spec.rb +1 -1
  154. data/spec/github/users/followers/is_following_spec.rb +1 -1
  155. data/spec/github/users/followers/unfollow_spec.rb +1 -1
  156. data/spec/github/users/keys/delete_spec.rb +1 -1
  157. data/spec/github/users/keys/get_spec.rb +1 -1
  158. data/spec/github/users/keys/update_spec.rb +1 -1
  159. data/spec/github/users/update_spec.rb +1 -1
  160. data/spec/integration/arguments_spec.rb +76 -0
  161. data/spec/{github → integration}/authorizations_spec.rb +0 -0
  162. metadata +44 -35
  163. data/spec/github/repos/pub_sub_hubbub_spec.rb +0 -78
@@ -18,7 +18,7 @@ describe Github::Users::Followers, '#follow' do
18
18
  after { reset_authentication_for(subject) }
19
19
 
20
20
  it "should raise error if gist id not present" do
21
- expect { subject.follow nil }.to raise_error(ArgumentError)
21
+ expect { subject.follow }.to raise_error(ArgumentError)
22
22
  end
23
23
 
24
24
  it 'successfully unfollows a user' do
@@ -18,7 +18,7 @@ describe Github::Users::Followers, '#following?' do
18
18
  after { reset_authentication_for(subject) }
19
19
 
20
20
  it 'should raise error if username not present' do
21
- expect { subject.following? nil }.to raise_error(ArgumentError)
21
+ expect { subject.following? }.to raise_error(ArgumentError)
22
22
  end
23
23
 
24
24
  it 'should perform request' do
@@ -18,7 +18,7 @@ describe Github::Users::Followers, '#unfollow' do
18
18
  after { reset_authentication_for(subject) }
19
19
 
20
20
  it "should raise error if gist id not present" do
21
- expect { subject.unfollow nil }.to raise_error(ArgumentError)
21
+ expect { subject.unfollow }.to raise_error(ArgumentError)
22
22
  end
23
23
 
24
24
  it 'successfully unfollows a user' do
@@ -20,7 +20,7 @@ describe Github::Users::Keys, '#delete' do
20
20
  let(:status) { 204 }
21
21
 
22
22
  it "should fail to get resource without key id" do
23
- expect { subject.delete nil }.to raise_error(ArgumentError)
23
+ expect { subject.delete }.to raise_error(ArgumentError)
24
24
  end
25
25
 
26
26
  it "should create resource successfully" do
@@ -22,7 +22,7 @@ describe Github::Users::Keys, '#get' do
22
22
  it { should respond_to :find }
23
23
 
24
24
  it "should fail to get resource without key id" do
25
- expect { subject.get nil }.to raise_error(ArgumentError)
25
+ expect { subject.get }.to raise_error(ArgumentError)
26
26
  end
27
27
 
28
28
  it "should get the resource" do
@@ -29,7 +29,7 @@ describe Github::Users::Keys, '#update' do
29
29
  let(:status) { 201 }
30
30
 
31
31
  it "should fail to get resource without key id" do
32
- expect { subject.update nil }.to raise_error(ArgumentError)
32
+ expect { subject.update }.to raise_error(ArgumentError)
33
33
  end
34
34
 
35
35
  it "should create resource successfully" do
@@ -24,7 +24,7 @@ describe Github::Users, '#update' do
24
24
  "company" => "GitHub",
25
25
  "location" => "San Francisco",
26
26
  "hireable" => true,
27
- "bio" => "There once...",
27
+ "bio" => "There once..."
28
28
  }
29
29
  }
30
30
 
@@ -0,0 +1,76 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe 'Arguments' do
6
+ let(:user) { 'peter-murach' }
7
+ let(:repo) { 'github-api' }
8
+ let(:api) { Github::Issues.new :user => user, :repo => repo }
9
+ let(:body) { '[]' }
10
+ let(:status) { 200 }
11
+
12
+ subject { api.milestones }
13
+
14
+ context 'with existing arguments' do
15
+ let(:request_path) { "/repos/#{user}/#{repo}/milestones" }
16
+
17
+ before {
18
+ stub_get(request_path).to_return(:body => body, :status => status,
19
+ :headers => {:content_type => "application/json; charset=utf-8"})
20
+ }
21
+
22
+ it { subject.user.should == user }
23
+
24
+ it { subject.repo.should == repo }
25
+
26
+ it 'performs request' do
27
+ subject.list
28
+ a_get(request_path).should have_been_made
29
+ end
30
+
31
+ it "does not set argument to nil" do
32
+ subject.list
33
+ subject.user.should == user
34
+ end
35
+ end
36
+
37
+ context 'with new arguments' do
38
+ let(:milestone_id) { 11 }
39
+ let(:request_path) { "/repos/#{user}/#{repo}/milestones/#{milestone_id}" }
40
+
41
+ before {
42
+ stub_get(request_path).to_return(:body => body, :status => status,
43
+ :headers => {:content_type => "application/json; charset=utf-8"})
44
+ }
45
+
46
+ it { expect { subject.milestone_id }.to raise_error(NoMethodError) }
47
+
48
+ it {
49
+ subject.get user, repo, milestone_id
50
+ a_get(request_path).should have_been_made
51
+ }
52
+
53
+ it 'reads user & repo settings' do
54
+ subject.get :milestone_id => milestone_id
55
+ a_get(request_path).should have_been_made
56
+ end
57
+
58
+ it 'reads user & repo and requires milestone_id' do
59
+ expect { subject.get milestone_id }.to raise_error(ArgumentError)
60
+ end
61
+
62
+ it 'requires extra parameter' do
63
+ expect { subject.get user, repo }.to raise_error(ArgumentError)
64
+ end
65
+
66
+ it 'requires milestone_id to be set' do
67
+ expect { subject.get }.to raise_error(ArgumentError)
68
+ end
69
+
70
+ it 'creates setter' do
71
+ subject.get user, repo, milestone_id
72
+ subject.milestone_id.should == milestone_id
73
+ end
74
+
75
+ end
76
+ end
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,22 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-18 00:00:00.000000000Z
12
+ date: 2013-02-24 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: hashie
16
- requirement: &2154928480 !ruby/object:Gem::Requirement
16
+ requirement: &2154681220 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 1.2.0
21
+ version: '2.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2154928480
24
+ version_requirements: *2154681220
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: faraday
27
- requirement: &2154927980 !ruby/object:Gem::Requirement
27
+ requirement: &2154680720 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.8.1
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2154927980
35
+ version_requirements: *2154680720
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: multi_json
38
- requirement: &2154927520 !ruby/object:Gem::Requirement
38
+ requirement: &2154680260 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '1.4'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2154927520
46
+ version_requirements: *2154680260
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: oauth2
49
- requirement: &2154927140 !ruby/object:Gem::Requirement
49
+ requirement: &2154679880 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *2154927140
57
+ version_requirements: *2154679880
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: nokogiri
60
- requirement: &2154926600 !ruby/object:Gem::Requirement
60
+ requirement: &2154679340 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 1.5.2
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *2154926600
68
+ version_requirements: *2154679340
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
- requirement: &2154926100 !ruby/object:Gem::Requirement
71
+ requirement: &2154678840 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *2154926100
79
+ version_requirements: *2154678840
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: cucumber
82
- requirement: &2154925640 !ruby/object:Gem::Requirement
82
+ requirement: &2154678380 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *2154925640
90
+ version_requirements: *2154678380
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: webmock
93
- requirement: &2154925180 !ruby/object:Gem::Requirement
93
+ requirement: &2154667660 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: 1.9.0
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *2154925180
101
+ version_requirements: *2154667660
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: vcr
104
- requirement: &2154924720 !ruby/object:Gem::Requirement
104
+ requirement: &2154667200 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ~>
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: 2.4.0
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *2154924720
112
+ version_requirements: *2154667200
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: simplecov
115
- requirement: &2154924260 !ruby/object:Gem::Requirement
115
+ requirement: &2154666740 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ~>
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: 0.7.1
121
121
  type: :development
122
122
  prerelease: false
123
- version_requirements: *2154924260
123
+ version_requirements: *2154666740
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: guard
126
- requirement: &2154923880 !ruby/object:Gem::Requirement
126
+ requirement: &2154666360 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ! '>='
@@ -131,10 +131,10 @@ dependencies:
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
- version_requirements: *2154923880
134
+ version_requirements: *2154666360
135
135
  - !ruby/object:Gem::Dependency
136
136
  name: guard-rspec
137
- requirement: &2154923420 !ruby/object:Gem::Requirement
137
+ requirement: &2154665900 !ruby/object:Gem::Requirement
138
138
  none: false
139
139
  requirements:
140
140
  - - ! '>='
@@ -142,10 +142,10 @@ dependencies:
142
142
  version: '0'
143
143
  type: :development
144
144
  prerelease: false
145
- version_requirements: *2154923420
145
+ version_requirements: *2154665900
146
146
  - !ruby/object:Gem::Dependency
147
147
  name: guard-cucumber
148
- requirement: &2154919140 !ruby/object:Gem::Requirement
148
+ requirement: &2154665480 !ruby/object:Gem::Requirement
149
149
  none: false
150
150
  requirements:
151
151
  - - ! '>='
@@ -153,10 +153,10 @@ dependencies:
153
153
  version: '0'
154
154
  type: :development
155
155
  prerelease: false
156
- version_requirements: *2154919140
156
+ version_requirements: *2154665480
157
157
  - !ruby/object:Gem::Dependency
158
158
  name: rake
159
- requirement: &2154918720 !ruby/object:Gem::Requirement
159
+ requirement: &2154665060 !ruby/object:Gem::Requirement
160
160
  none: false
161
161
  requirements:
162
162
  - - ! '>='
@@ -164,10 +164,10 @@ dependencies:
164
164
  version: '0'
165
165
  type: :development
166
166
  prerelease: false
167
- version_requirements: *2154918720
167
+ version_requirements: *2154665060
168
168
  - !ruby/object:Gem::Dependency
169
169
  name: bundler
170
- requirement: &2154918300 !ruby/object:Gem::Requirement
170
+ requirement: &2154664640 !ruby/object:Gem::Requirement
171
171
  none: false
172
172
  requirements:
173
173
  - - ! '>='
@@ -175,7 +175,7 @@ dependencies:
175
175
  version: '0'
176
176
  type: :development
177
177
  prerelease: false
178
- version_requirements: *2154918300
178
+ version_requirements: *2154664640
179
179
  description: ! ' Ruby wrapper that supports all of the GitHub API v3 methods(nearly
180
180
  200). It''s build in a modular way, that is, you can either instantiate the whole
181
181
  api wrapper Github.new or use parts of it e.i. Github::Repos.new if working solely
@@ -221,6 +221,7 @@ files:
221
221
  - features/cassettes/gists/star.yml
222
222
  - features/cassettes/gists/starred.yml
223
223
  - features/cassettes/gists/unstar.yml
224
+ - features/cassettes/git_data/commits/get.yml
224
225
  - features/cassettes/git_data/references/all.yml
225
226
  - features/cassettes/git_data/references/all_tags.yml
226
227
  - features/cassettes/git_data/references/one.yml
@@ -322,6 +323,7 @@ files:
322
323
  - features/error_codes.feature
323
324
  - features/gists/comments.feature
324
325
  - features/gists.feature
326
+ - features/git_data/commmits.feature
325
327
  - features/git_data/references.feature
326
328
  - features/github_api.feature
327
329
  - features/gitignore.feature
@@ -364,6 +366,7 @@ files:
364
366
  - lib/github_api/api/actions.rb
365
367
  - lib/github_api/api.rb
366
368
  - lib/github_api/api_factory.rb
369
+ - lib/github_api/arguments.rb
367
370
  - lib/github_api/authorization.rb
368
371
  - lib/github_api/authorizations.rb
369
372
  - lib/github_api/client.rb
@@ -580,15 +583,16 @@ files:
580
583
  - spec/github/activity/watching/watched_spec.rb
581
584
  - spec/github/activity/watching/watching_spec.rb
582
585
  - spec/github/api/set_spec.rb
586
+ - spec/github/api/with_spec.rb
583
587
  - spec/github/api_factory_spec.rb
584
588
  - spec/github/api_spec.rb
589
+ - spec/github/arguments/parse_spec.rb
585
590
  - spec/github/authorization_spec.rb
586
591
  - spec/github/authorizations/create_spec.rb
587
592
  - spec/github/authorizations/delete_spec.rb
588
593
  - spec/github/authorizations/get_spec.rb
589
594
  - spec/github/authorizations/list_spec.rb
590
595
  - spec/github/authorizations/update_spec.rb
591
- - spec/github/authorizations_spec.rb
592
596
  - spec/github/client_spec.rb
593
597
  - spec/github/core_ext/hash_spec.rb
594
598
  - spec/github/deprecation_spec.rb
@@ -756,7 +760,10 @@ files:
756
760
  - spec/github/repos/languages_spec.rb
757
761
  - spec/github/repos/list_spec.rb
758
762
  - spec/github/repos/merging/merge_spec.rb
759
- - spec/github/repos/pub_sub_hubbub_spec.rb
763
+ - spec/github/repos/pub_sub_hubbub/subscribe_service_spec.rb
764
+ - spec/github/repos/pub_sub_hubbub/subscribe_spec.rb
765
+ - spec/github/repos/pub_sub_hubbub/unsubscribe_service_spec.rb
766
+ - spec/github/repos/pub_sub_hubbub/unsubscribe_spec.rb
760
767
  - spec/github/repos/statuses/create_spec.rb
761
768
  - spec/github/repos/statuses/list_spec.rb
762
769
  - spec/github/repos/statuses_spec.rb
@@ -795,6 +802,8 @@ files:
795
802
  - spec/github/validations_spec.rb
796
803
  - spec/github_spec.rb
797
804
  - spec/integration/activity_spec.rb
805
+ - spec/integration/arguments_spec.rb
806
+ - spec/integration/authorizations_spec.rb
798
807
  - spec/integration/gists_spec.rb
799
808
  - spec/integration/git_data_spec.rb
800
809
  - spec/integration/issues_spec.rb
@@ -1,78 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Github::Repos::PubSubHubbub do
4
- let(:topic) { "https://github.com/peter-murach/github/events/push"}
5
- let(:callback) { "github://campfire?subdomain=github&room=Commits&token=abc123" }
6
- let(:hub_inputs) {
7
- {
8
- "hub.mode" => 'subscribe',
9
- "hub.topic" => topic,
10
- "hub.callback" => callback,
11
- "hub.verify" => 'sync',
12
- "hub.secret" => ''
13
- }
14
- }
15
-
16
- after { reset_authentication_for subject }
17
-
18
- describe "subscribe" do
19
- context "success" do
20
- before do
21
- subject.oauth_token = OAUTH_TOKEN
22
- stub_post("/hub?access_token=#{OAUTH_TOKEN}").with(hub_inputs).
23
- to_return(:body => '[]', :status => 200,
24
- :headers => {:content_type => "application/json; charset=utf-8"})
25
- end
26
-
27
- it "should subscribe to hub" do
28
- subject.subscribe topic, callback
29
- a_post("/hub?access_token=#{OAUTH_TOKEN}").with(hub_inputs).should have_been_made
30
- end
31
- end
32
-
33
- context "failure" do
34
- before do
35
- subject.oauth_token = OAUTH_TOKEN
36
- stub_post("/hub?access_token=#{OAUTH_TOKEN}").with(hub_inputs).
37
- to_return(:body => '[]', :status => 404,
38
- :headers => {:content_type => "application/json; charset=utf-8"})
39
- end
40
-
41
- it "should fail to subscribe to hub" do
42
- expect {
43
- subject.subscribe topic, callback
44
- }.to raise_error(Github::Error::NotFound)
45
- end
46
- end
47
- end # subscribe
48
-
49
- describe "unsubscribe" do
50
- context "success" do
51
- before do
52
- subject.oauth_token = OAUTH_TOKEN
53
- stub_post("/hub?access_token=#{OAUTH_TOKEN}").with(hub_inputs.merge("hub.mode" => 'unsubscribe')).
54
- to_return(:body => '[]', :status => 200,
55
- :headers => {:content_type => "application/json; charset=utf-8"})
56
- end
57
-
58
- it "should subscribe to hub" do
59
- subject.unsubscribe topic, callback
60
- a_post("/hub?access_token=#{OAUTH_TOKEN}").with(hub_inputs).should have_been_made
61
- end
62
- end
63
-
64
- context "failure" do
65
- before do
66
- subject.oauth_token = OAUTH_TOKEN
67
- stub_post("/hub?access_token=#{OAUTH_TOKEN}").with(hub_inputs.merge("hub.mode" => 'unsubscribe')).
68
- to_return(:body => '[]', :status => 404, :headers => {:content_type => "application/json; charset=utf-8"})
69
- end
70
-
71
- it "should fail to subscribe to hub" do
72
- expect {
73
- subject.unsubscribe topic, callback
74
- }.to raise_error(Github::Error::NotFound)
75
- end
76
- end
77
- end # unsubscribe
78
- end # Github::Repos::PubSubHubbub