octokit 0.6.3 → 0.6.4
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/.travis.yml +1 -0
- data/CHANGELOG.md +18 -18
- data/README.md +5 -3
- data/Rakefile +2 -0
- data/lib/faraday/response/{raise_error.rb → raise_octokit_error.rb} +11 -2
- data/lib/octokit.rb +18 -46
- data/lib/octokit/authentication.rb +21 -0
- data/lib/octokit/client.rb +13 -6
- data/lib/octokit/client/commits.rb +2 -2
- data/lib/octokit/client/issues.rb +184 -21
- data/lib/octokit/client/milestones.rb +87 -0
- data/lib/octokit/client/network.rb +2 -4
- data/lib/octokit/client/objects.rb +6 -8
- data/lib/octokit/client/organizations.rb +18 -19
- data/lib/octokit/client/pub_sub_hubbub.rb +41 -0
- data/lib/octokit/client/pub_sub_hubbub/service_hooks.rb +41 -0
- data/lib/octokit/client/pulls.rb +12 -3
- data/lib/octokit/client/repositories.rb +28 -30
- data/lib/octokit/client/timelines.rb +3 -5
- data/lib/octokit/client/users.rb +40 -18
- data/lib/octokit/connection.rb +42 -0
- data/lib/octokit/error.rb +34 -0
- data/lib/octokit/request.rb +44 -0
- data/lib/octokit/version.rb +1 -1
- data/octokit.gemspec +33 -28
- data/puppeteer.jpg +0 -0
- data/spec/faraday/response_spec.rb +2 -1
- data/spec/fixtures/v2/commit.json +1 -1
- data/spec/fixtures/v3/comment.json +14 -0
- data/spec/fixtures/v3/comments.json +44 -0
- data/spec/fixtures/v3/label.json +5 -0
- data/spec/fixtures/v3/labels.json +17 -0
- data/spec/fixtures/v3/milestone.json +12 -0
- data/spec/fixtures/v3/milestones.json +28 -0
- data/spec/fixtures/v3/not_found.json +3 -0
- data/spec/fixtures/v3/user.json +20 -0
- data/spec/helper.rb +14 -11
- data/spec/octokit/client/commits_spec.rb +3 -3
- data/spec/octokit/client/issues_spec.rb +82 -44
- data/spec/octokit/client/milestones_spec.rb +67 -0
- data/spec/octokit/client/objects_spec.rb +6 -6
- data/spec/octokit/client/organizations_spec.rb +19 -19
- data/spec/octokit/client/pub_sub_hubbub/service_hooks_spec.rb +45 -0
- data/spec/octokit/client/pub_sub_hubbub_spec.rb +49 -0
- data/spec/octokit/client/pulls_spec.rb +15 -3
- data/spec/octokit/client/repositories_spec.rb +30 -30
- data/spec/octokit/client/users_spec.rb +26 -26
- data/spec/octokit/client_spec.rb +2 -2
- data/spec/octokit_spec.rb +12 -3
- metadata +147 -55
- data/lib/octokit/client/authentication.rb +0 -23
- data/lib/octokit/client/connection.rb +0 -33
- data/lib/octokit/client/request.rb +0 -42
@@ -0,0 +1,28 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"url": "https://api.github.com/repos/pengwynn/octokit/milestones/1",
|
4
|
+
"due_on": "2011-05-01T07:00:00Z",
|
5
|
+
"closed_issues": 1,
|
6
|
+
"created_at": "2011-04-29T19:50:34Z",
|
7
|
+
"open_issues": 5,
|
8
|
+
"description": "Add support for API v3",
|
9
|
+
"state": "open",
|
10
|
+
"title": "0.7.0",
|
11
|
+
"number": 1,
|
12
|
+
"creator": {
|
13
|
+
"type": "User",
|
14
|
+
"location": "San Francisco",
|
15
|
+
"url": "https://api.github.com/users/sferik",
|
16
|
+
"login": "sferik",
|
17
|
+
"gravatar_url": "https://secure.gravatar.com/avatar/1f74b13f1e5c6c69cb5d7fbaabb1e2cb?s=30&d=https://d3nwyuy0nl342s.cloudfront.net%2Fimages%2Fgravatars%2Fgravatar-140.png",
|
18
|
+
"email": "sferik@gmail.com",
|
19
|
+
"hireable": false,
|
20
|
+
"company": "Code for America",
|
21
|
+
"blog": "http://twitter.com/sferik",
|
22
|
+
"created_at": "2008-05-14T20:36:12Z",
|
23
|
+
"bio": null,
|
24
|
+
"name": "Erik Michaels-Ober",
|
25
|
+
"html_url": "https://github.com/sferik"
|
26
|
+
}
|
27
|
+
}
|
28
|
+
]
|
@@ -0,0 +1,20 @@
|
|
1
|
+
{
|
2
|
+
"type": "User",
|
3
|
+
"location": "San Francisco",
|
4
|
+
"url": "https://api.github.com/users/sferik",
|
5
|
+
"avatar_url": "https://secure.gravatar.com/avatar/1f74b13f1e5c6c69cb5d7fbaabb1e2cb?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
|
6
|
+
"public_repos": 37,
|
7
|
+
"public_gists": 18,
|
8
|
+
"blog": "http://twitter.com/sferik",
|
9
|
+
"name": "Erik Michaels-Ober",
|
10
|
+
"hireable": false,
|
11
|
+
"login": "sferik",
|
12
|
+
"followers": 205,
|
13
|
+
"following": 91,
|
14
|
+
"created_at": "2008-05-14T20:36:12Z",
|
15
|
+
"email": "sferik@gmail.com",
|
16
|
+
"id": 10308,
|
17
|
+
"html_url": "https://github.com/sferik",
|
18
|
+
"company": "Code for America",
|
19
|
+
"bio": null
|
20
|
+
}
|
data/spec/helper.rb
CHANGED
@@ -1,15 +1,10 @@
|
|
1
|
+
$:.unshift File.expand_path('..', __FILE__)
|
2
|
+
$:.unshift File.expand_path('../../lib', __FILE__)
|
1
3
|
require 'simplecov'
|
2
|
-
SimpleCov.start
|
3
|
-
add_group 'Octokit', 'lib/octokit'
|
4
|
-
add_group 'Faraday Middleware', 'lib/faraday'
|
5
|
-
add_group 'Specs', 'spec'
|
6
|
-
end
|
4
|
+
SimpleCov.start
|
7
5
|
require 'octokit'
|
8
6
|
require 'rspec'
|
9
7
|
require 'webmock/rspec'
|
10
|
-
RSpec.configure do |config|
|
11
|
-
config.include WebMock::API
|
12
|
-
end
|
13
8
|
|
14
9
|
def a_delete(url)
|
15
10
|
a_request(:delete, github_url(url))
|
@@ -19,6 +14,10 @@ def a_get(url)
|
|
19
14
|
a_request(:get, github_url(url))
|
20
15
|
end
|
21
16
|
|
17
|
+
def a_patch(url)
|
18
|
+
a_request(:patch, github_url(url))
|
19
|
+
end
|
20
|
+
|
22
21
|
def a_post(url)
|
23
22
|
a_request(:post, github_url(url))
|
24
23
|
end
|
@@ -35,6 +34,10 @@ def stub_get(url)
|
|
35
34
|
stub_request(:get, github_url(url))
|
36
35
|
end
|
37
36
|
|
37
|
+
def stub_patch(url)
|
38
|
+
stub_request(:patch, github_url(url))
|
39
|
+
end
|
40
|
+
|
38
41
|
def stub_post(url)
|
39
42
|
stub_request(:post, github_url(url))
|
40
43
|
end
|
@@ -55,10 +58,10 @@ def github_url(url)
|
|
55
58
|
if url =~ /^http/
|
56
59
|
url
|
57
60
|
elsif @client && @client.authenticated?
|
58
|
-
"https://pengwynn%2Ftoken:OU812@github.com
|
61
|
+
"https://pengwynn%2Ftoken:OU812@github.com#{url}"
|
59
62
|
elsif @client && @client.oauthed?
|
60
|
-
"https://github.com
|
63
|
+
"https://github.com#{url}?access_token=#{@client.oauth_token}"
|
61
64
|
else
|
62
|
-
"https://github.com
|
65
|
+
"https://github.com#{url}"
|
63
66
|
end
|
64
67
|
end
|
@@ -10,7 +10,7 @@ describe Octokit::Client::Pulls do
|
|
10
10
|
describe ".commits" do
|
11
11
|
|
12
12
|
it "should return all commits" do
|
13
|
-
stub_get("commits/list/sferik/rails_admin/master").
|
13
|
+
stub_get("/api/v2/json/commits/list/sferik/rails_admin/master").
|
14
14
|
to_return(:body => fixture("v2/commits.json"))
|
15
15
|
commits = @client.commits("sferik/rails_admin")
|
16
16
|
commits.first.author.login.should == "caboteria"
|
@@ -21,10 +21,10 @@ describe Octokit::Client::Pulls do
|
|
21
21
|
describe ".commit" do
|
22
22
|
|
23
23
|
it "should return a commit" do
|
24
|
-
stub_get("commits/show/sferik/rails_admin/3cdfabd973bc3caac209cba903cfdb3bf6636bcd").
|
24
|
+
stub_get("/api/v2/json/commits/show/sferik/rails_admin/3cdfabd973bc3caac209cba903cfdb3bf6636bcd").
|
25
25
|
to_return(:body => fixture("v2/commit.json"))
|
26
26
|
commit = @client.commit("sferik/rails_admin", "3cdfabd973bc3caac209cba903cfdb3bf6636bcd")
|
27
|
-
commit.
|
27
|
+
commit.author.login.should == "caboteria"
|
28
28
|
end
|
29
29
|
|
30
30
|
end
|
@@ -10,7 +10,7 @@ describe Octokit::Client::Issues do
|
|
10
10
|
describe ".search_issues" do
|
11
11
|
|
12
12
|
it "should return matching issues" do
|
13
|
-
stub_get("issues/search/sferik/rails_admin/open/activerecord").
|
13
|
+
stub_get("/api/v2/json/issues/search/sferik/rails_admin/open/activerecord").
|
14
14
|
to_return(:body => fixture("v2/issues.json"))
|
15
15
|
issues = @client.search_issues("sferik/rails_admin", "activerecord")
|
16
16
|
issues.first.number.should == 105
|
@@ -21,28 +21,18 @@ describe Octokit::Client::Issues do
|
|
21
21
|
describe ".list_issues" do
|
22
22
|
|
23
23
|
it "should return issues" do
|
24
|
-
|
25
|
-
|
26
|
-
to_return(:body => fixture("v2/issues.json"))
|
24
|
+
stub_get("https://api.github.com/repos/sferik/rails_admin/issues").
|
25
|
+
to_return(:body => fixture("v3/issues.json"))
|
27
26
|
issues = @client.issues("sferik/rails_admin")
|
28
|
-
issues.first.number.should ==
|
27
|
+
issues.first.number.should == 388
|
29
28
|
end
|
30
29
|
|
31
30
|
end
|
32
31
|
|
33
|
-
describe ".issues_labeled" do
|
34
|
-
it "should return issues with a particular label" do
|
35
|
-
stub_get("issues/list/sferik/rails_admin/label/bug").
|
36
|
-
to_return(:body => fixture("v2/issues.json"))
|
37
|
-
issues = @client.issues_labeled("sferik/rails_admin", "bug")
|
38
|
-
issues.first.number.should == 105
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
32
|
describe ".create_issue" do
|
43
33
|
|
44
34
|
it "should create an issue" do
|
45
|
-
stub_post("issues/open/sferik/rails_admin").
|
35
|
+
stub_post("/api/v2/json/issues/open/sferik/rails_admin").
|
46
36
|
to_return(:body => fixture("v2/issue.json"))
|
47
37
|
issue = @client.create_issue("sferik/rails_admin", "Use OrmAdapter instead of talking directly to ActiveRecord", "Hi,\n\nI just tried to play with this in an app with no ActiveRecord. I was disappointed. It seems the only reason the engine relies on AR is to provide History functionality. I would argue that having the History in a database, and therefore tying the app to AR & SQL, isn't worth it. How about we change it to just dump to a CSV and remove the AR dep?\n\n$0.02")
|
48
38
|
issue.number.should == 105
|
@@ -53,7 +43,7 @@ describe Octokit::Client::Issues do
|
|
53
43
|
describe ".issue" do
|
54
44
|
|
55
45
|
it "should return an issue" do
|
56
|
-
stub_get("issues/show/sferik/rails_admin/105").
|
46
|
+
stub_get("/api/v2/json/issues/show/sferik/rails_admin/105").
|
57
47
|
to_return(:body => fixture("v2/issue.json"))
|
58
48
|
issue = @client.issue("sferik/rails_admin", 105)
|
59
49
|
issue.number.should == 105
|
@@ -61,21 +51,10 @@ describe Octokit::Client::Issues do
|
|
61
51
|
|
62
52
|
end
|
63
53
|
|
64
|
-
describe ".issue_comments" do
|
65
|
-
|
66
|
-
it "should return comments for an issue" do
|
67
|
-
stub_get("issues/comments/sferik/rails_admin/105").
|
68
|
-
to_return(:body => fixture("v2/comments.json"))
|
69
|
-
comments = @client.issue_comments("sferik/rails_admin", 105)
|
70
|
-
comments.first.user.should == "jackdempsey"
|
71
|
-
end
|
72
|
-
|
73
|
-
end
|
74
|
-
|
75
54
|
describe ".close_issue" do
|
76
55
|
|
77
56
|
it "should close an issue" do
|
78
|
-
stub_post("issues/close/sferik/rails_admin/105").
|
57
|
+
stub_post("/api/v2/json/issues/close/sferik/rails_admin/105").
|
79
58
|
to_return(:body => fixture("v2/issue.json"))
|
80
59
|
issue = @client.close_issue("sferik/rails_admin", 105)
|
81
60
|
issue.number.should == 105
|
@@ -86,7 +65,7 @@ describe Octokit::Client::Issues do
|
|
86
65
|
describe ".reopen_issue" do
|
87
66
|
|
88
67
|
it "should reopen an issue" do
|
89
|
-
stub_post("issues/reopen/sferik/rails_admin/105").
|
68
|
+
stub_post("/api/v2/json/issues/reopen/sferik/rails_admin/105").
|
90
69
|
to_return(:body => fixture("v2/issue.json"))
|
91
70
|
issue = @client.reopen_issue("sferik/rails_admin", 105)
|
92
71
|
issue.number.should == 105
|
@@ -97,7 +76,7 @@ describe Octokit::Client::Issues do
|
|
97
76
|
describe ".update_issue" do
|
98
77
|
|
99
78
|
it "should update an issue" do
|
100
|
-
stub_post("issues/edit/sferik/rails_admin/105").
|
79
|
+
stub_post("/api/v2/json/issues/edit/sferik/rails_admin/105").
|
101
80
|
to_return(:body => fixture("v2/issue.json"))
|
102
81
|
issue = @client.update_issue("sferik/rails_admin", 105, "Use OrmAdapter instead of talking directly to ActiveRecord", "Hi,\n\nI just tried to play with this in an app with no ActiveRecord. I was disappointed. It seems the only reason the engine relies on AR is to provide History functionality. I would argue that having the History in a database, and therefore tying the app to AR & SQL, isn't worth it. How about we change it to just dump to a CSV and remove the AR dep?\n\n$0.02")
|
103
82
|
issue.number.should == 105
|
@@ -108,10 +87,21 @@ describe Octokit::Client::Issues do
|
|
108
87
|
describe ".labels" do
|
109
88
|
|
110
89
|
it "should return labels" do
|
111
|
-
stub_get("
|
112
|
-
to_return(:body => fixture("
|
113
|
-
labels = @client.labels("
|
114
|
-
labels.first.should == "
|
90
|
+
stub_get("https://api.github.com/repos/pengwynn/octokit/labels").
|
91
|
+
to_return(:body => fixture("v3/labels.json"))
|
92
|
+
labels = @client.labels("pengwynn/octokit")
|
93
|
+
labels.first.name.should == "V3 Transition"
|
94
|
+
end
|
95
|
+
|
96
|
+
end
|
97
|
+
|
98
|
+
describe ".label" do
|
99
|
+
|
100
|
+
it "should return a single labels" do
|
101
|
+
stub_get("https://api.github.com/repos/pengwynn/octokit/labels/V3%20Addition").
|
102
|
+
to_return(:status => 200, :body => fixture('v3/label.json'))
|
103
|
+
label = @client.label("pengwynn/octokit", 'V3 Addition')
|
104
|
+
label.name.should == "V3 Addition"
|
115
105
|
end
|
116
106
|
|
117
107
|
end
|
@@ -119,10 +109,11 @@ describe Octokit::Client::Issues do
|
|
119
109
|
describe ".add_label" do
|
120
110
|
|
121
111
|
it "should add a label" do
|
122
|
-
stub_post("
|
123
|
-
to_return(:body => fixture(
|
124
|
-
labels = @client.add_label("
|
125
|
-
labels.
|
112
|
+
stub_post("https://api.github.com/repos/pengwynn/octokit/labels").
|
113
|
+
to_return(:status => 201, :body => fixture('v3/label.json'))
|
114
|
+
labels = @client.add_label("pengwynn/octokit", "bug", 'ededed')
|
115
|
+
labels.color.should == "ededed"
|
116
|
+
labels.name.should == "V3 Addition"
|
126
117
|
end
|
127
118
|
|
128
119
|
end
|
@@ -130,7 +121,7 @@ describe Octokit::Client::Issues do
|
|
130
121
|
describe ".remove_label" do
|
131
122
|
|
132
123
|
it "should remove a label" do
|
133
|
-
stub_post("issues/label/remove/sferik/rails_admin/bug").
|
124
|
+
stub_post("/api/v2/json/issues/label/remove/sferik/rails_admin/bug").
|
134
125
|
to_return(:body => fixture("v2/labels.json"))
|
135
126
|
labels = @client.remove_label("sferik/rails_admin", "bug")
|
136
127
|
labels.first.should == "bug"
|
@@ -138,16 +129,63 @@ describe Octokit::Client::Issues do
|
|
138
129
|
|
139
130
|
end
|
140
131
|
|
132
|
+
describe ".issue_comments" do
|
133
|
+
|
134
|
+
it "should return comments for an issue" do
|
135
|
+
stub_get("https://api.github.com/repos/pengwynn/octokit/issues/25/comments").
|
136
|
+
to_return(:status => 200, :body => fixture('v3/comments.json'))
|
137
|
+
comments = @client.issue_comments("pengwynn/octokit", 25)
|
138
|
+
comments.first.user.login.should == "ctshryock"
|
139
|
+
end
|
140
|
+
|
141
|
+
end
|
142
|
+
|
143
|
+
describe ".issue_comment" do
|
144
|
+
|
145
|
+
it "should return a single comment for an issue" do
|
146
|
+
stub_get("https://api.github.com/repos/pengwynn/octokit/issues/comments/25").
|
147
|
+
to_return(:status => 200, :body => fixture('v3/comment.json'))
|
148
|
+
comments = @client.issue_comment("pengwynn/octokit", 25)
|
149
|
+
comments.user.login.should == "ctshryock"
|
150
|
+
comments.url.should == "https://api.github.com/repos/pengwynn/octokit/issues/comments/1194690"
|
151
|
+
end
|
152
|
+
|
153
|
+
end
|
154
|
+
|
141
155
|
describe ".add_comment" do
|
142
156
|
|
143
157
|
it "should add a comment" do
|
144
|
-
stub_post("
|
145
|
-
with(:
|
146
|
-
|
147
|
-
|
148
|
-
comment.
|
158
|
+
stub_post("https://api.github.com/repos/pengwynn/octokit/issues/25/comments").
|
159
|
+
with(:body => "{\"body\":\"A test comment\"}",
|
160
|
+
:headers => {'Content-Type'=>'application/json'}).
|
161
|
+
to_return(:status => 201, :body => fixture('v3/comment.json'))
|
162
|
+
comment = @client.add_comment("pengwynn/octokit", 25, "A test comment")
|
163
|
+
comment.user.login.should == "ctshryock"
|
164
|
+
end
|
165
|
+
|
166
|
+
end
|
167
|
+
|
168
|
+
describe ".update_comment" do
|
169
|
+
|
170
|
+
it "should update an existing comment" do
|
171
|
+
stub_post("https://api.github.com/repos/pengwynn/octokit/issues/comments/1194549").
|
172
|
+
with(:body => "{\"body\":\"A test comment update\"}",
|
173
|
+
:headers => {'Content-Type'=>'application/json'}).
|
174
|
+
to_return(:status => 200, :body => fixture('v3/comment.json'))
|
175
|
+
comment = @client.update_comment("pengwynn/octokit", 1194549, "A test comment update")
|
176
|
+
comment.user.login.should == "ctshryock"
|
149
177
|
end
|
150
178
|
|
151
179
|
end
|
152
180
|
|
181
|
+
describe ".delete_comment" do
|
182
|
+
|
183
|
+
it "should delete an existing comment" do
|
184
|
+
stub_delete("https://api.github.com/repos/pengwynn/octokit/issues/comments/1194549").
|
185
|
+
to_return(:status => 204)
|
186
|
+
comment = @client.delete_comment("pengwynn/octokit", 1194549)
|
187
|
+
comment.status.should == 204
|
188
|
+
end
|
189
|
+
|
190
|
+
end
|
153
191
|
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require 'helper'
|
3
|
+
|
4
|
+
describe Octokit::Client::Milestones do
|
5
|
+
|
6
|
+
before do
|
7
|
+
@client = Octokit::Client.new(:login => 'sferik')
|
8
|
+
end
|
9
|
+
|
10
|
+
describe ".list_milestones" do
|
11
|
+
|
12
|
+
it "should list milestones belonging to repository" do
|
13
|
+
stub_get("https://api.github.com/repos/pengwynn/octokit/milestones").
|
14
|
+
to_return(:status => 200, :body => fixture('v3/milestones.json'))
|
15
|
+
milestones = @client.list_milestones("pengwynn/octokit")
|
16
|
+
milestones.first.description.should == "Add support for API v3"
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
describe ".milestone" do
|
22
|
+
|
23
|
+
it "should get a single milestone belonging to repository" do
|
24
|
+
stub_get("https://api.github.com/repos/pengwynn/octokit/milestones/1").
|
25
|
+
to_return(:status => 200, :body => fixture('v3/milestone.json'))
|
26
|
+
milestones = @client.milestone("pengwynn/octokit", 1)
|
27
|
+
milestones.description.should == "Add support for API v3"
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
describe ".create_milestone" do
|
33
|
+
|
34
|
+
it "should create a single milestone" do
|
35
|
+
stub_post("https://api.github.com/repos/pengwynn/octokit/milestones").
|
36
|
+
with(:body => '{"title":"0.7.0"}', :headers => {'Content-Type'=>'application/json'}).
|
37
|
+
to_return(:status => 201, :body => fixture('v3/milestone.json'))
|
38
|
+
milestone = @client.create_milestone("pengwynn/octokit", "0.7.0")
|
39
|
+
milestone.title.should == "0.7.0"
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
describe ".update_milestone" do
|
45
|
+
|
46
|
+
it "should update a milestone" do
|
47
|
+
stub_post("https://api.github.com/repos/pengwynn/octokit/milestones/1").
|
48
|
+
with(:body => "{\"description\":\"Add support for API v3\"}", :headers => {'Accept'=>'*/*', 'Content-Type'=>'application/json'}).
|
49
|
+
to_return(:status => 200, :body => fixture('v3/milestone.json'))
|
50
|
+
milestone = @client.update_milestone("pengwynn/octokit", 1, {:description => "Add support for API v3"})
|
51
|
+
milestone.description.should == "Add support for API v3"
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
describe ".delete_milestone" do
|
57
|
+
|
58
|
+
it "should delete a milestone from a repository" do
|
59
|
+
stub_delete("https://api.github.com/repos/pengwynn/octokit/milestones/2").
|
60
|
+
to_return(:status => 204, :body => "", :headers => {})
|
61
|
+
response = @client.delete_milestone("pengwynn/octokit", 2)
|
62
|
+
response.status.should == 204
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
@@ -10,7 +10,7 @@ describe Octokit::Client::Objects do
|
|
10
10
|
describe ".tree" do
|
11
11
|
|
12
12
|
it "should return a tree" do
|
13
|
-
stub_get("tree/show/sferik/rails_admin/3cdfabd973bc3caac209cba903cfdb3bf6636bcd").
|
13
|
+
stub_get("/api/v2/json/tree/show/sferik/rails_admin/3cdfabd973bc3caac209cba903cfdb3bf6636bcd").
|
14
14
|
to_return(:body => fixture("v2/tree.json"))
|
15
15
|
tree = @client.tree("sferik/rails_admin", "3cdfabd973bc3caac209cba903cfdb3bf6636bcd")
|
16
16
|
tree.first.name.should == ".gitignore"
|
@@ -21,7 +21,7 @@ describe Octokit::Client::Objects do
|
|
21
21
|
describe ".blob" do
|
22
22
|
|
23
23
|
it "should return a blob" do
|
24
|
-
stub_get("blob/show/sferik/rails_admin/3cdfabd973bc3caac209cba903cfdb3bf6636bcd/README.mkd").
|
24
|
+
stub_get("/api/v2/json/blob/show/sferik/rails_admin/3cdfabd973bc3caac209cba903cfdb3bf6636bcd/README.mkd").
|
25
25
|
to_return(:body => fixture("v2/blob.json"))
|
26
26
|
blob = @client.blob("sferik/rails_admin", "3cdfabd973bc3caac209cba903cfdb3bf6636bcd", "README.mkd")
|
27
27
|
blob.name.should == "README.mkd"
|
@@ -32,7 +32,7 @@ describe Octokit::Client::Objects do
|
|
32
32
|
describe ".blobs" do
|
33
33
|
|
34
34
|
it "should return blobs" do
|
35
|
-
stub_get("blob/all/sferik/rails_admin/3cdfabd973bc3caac209cba903cfdb3bf6636bcd").
|
35
|
+
stub_get("/api/v2/json/blob/all/sferik/rails_admin/3cdfabd973bc3caac209cba903cfdb3bf6636bcd").
|
36
36
|
to_return(:body => fixture("v2/blobs.json"))
|
37
37
|
blobs = @client.blobs("sferik/rails_admin", "3cdfabd973bc3caac209cba903cfdb3bf6636bcd")
|
38
38
|
blobs[".gitignore"].should == "5efe0eb47a773fa6ea84a0bf190ee218b6a31ead"
|
@@ -43,7 +43,7 @@ describe Octokit::Client::Objects do
|
|
43
43
|
describe ".blob_metadata" do
|
44
44
|
|
45
45
|
it "should return blob metadata" do
|
46
|
-
stub_get("blob/full/sferik/rails_admin/3cdfabd973bc3caac209cba903cfdb3bf6636bcd").
|
46
|
+
stub_get("/api/v2/json/blob/full/sferik/rails_admin/3cdfabd973bc3caac209cba903cfdb3bf6636bcd").
|
47
47
|
to_return(:body => fixture("v2/blob_metadata.json"))
|
48
48
|
blob_metadata = @client.blob_metadata("sferik/rails_admin", "3cdfabd973bc3caac209cba903cfdb3bf6636bcd")
|
49
49
|
blob_metadata.first.name.should == ".gitignore"
|
@@ -54,7 +54,7 @@ describe Octokit::Client::Objects do
|
|
54
54
|
describe ".tree_metadata" do
|
55
55
|
|
56
56
|
it "should return tree metadata" do
|
57
|
-
stub_get("tree/full/sferik/rails_admin/3cdfabd973bc3caac209cba903cfdb3bf6636bcd").
|
57
|
+
stub_get("/api/v2/json/tree/full/sferik/rails_admin/3cdfabd973bc3caac209cba903cfdb3bf6636bcd").
|
58
58
|
to_return(:body => fixture("v2/tree_metadata.json"))
|
59
59
|
tree_metadata = @client.tree_metadata("sferik/rails_admin", "3cdfabd973bc3caac209cba903cfdb3bf6636bcd")
|
60
60
|
tree_metadata.first.name.should == ".gitignore"
|
@@ -65,7 +65,7 @@ describe Octokit::Client::Objects do
|
|
65
65
|
describe ".raw" do
|
66
66
|
|
67
67
|
it "should return raw data" do
|
68
|
-
stub_get("blob/show/sferik/rails_admin/3cdfabd973bc3caac209cba903cfdb3bf6636bcd").
|
68
|
+
stub_get("/api/v2/json/blob/show/sferik/rails_admin/3cdfabd973bc3caac209cba903cfdb3bf6636bcd").
|
69
69
|
to_return(:body => fixture("v2/raw.txt"))
|
70
70
|
raw = @client.raw("sferik/rails_admin", "3cdfabd973bc3caac209cba903cfdb3bf6636bcd")
|
71
71
|
lambda {
|