ghi 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +7 -0
- data/lib/ghi/api.rb +4 -4
- data/spec/ghi/api_spec.rb +10 -10
- metadata +2 -2
data/History.rdoc
CHANGED
data/lib/ghi/api.rb
CHANGED
@@ -33,11 +33,11 @@ class GHI::API
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def open(title, body)
|
36
|
-
GHI::Issue.new post(:open,
|
36
|
+
GHI::Issue.new post(:open, "title" => title, "body" => body)["issue"]
|
37
37
|
end
|
38
38
|
|
39
39
|
def edit(number, title, body)
|
40
|
-
res = post :edit, number,
|
40
|
+
res = post :edit, number, "title" => title, "body" => body
|
41
41
|
GHI::Issue.new res["issue"]
|
42
42
|
end
|
43
43
|
|
@@ -58,7 +58,7 @@ class GHI::API
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def comment(number, comment)
|
61
|
-
post(:comment, number,
|
61
|
+
post(:comment, number, "comment" => comment)["comment"]
|
62
62
|
end
|
63
63
|
|
64
64
|
private
|
@@ -93,7 +93,7 @@ class GHI::API
|
|
93
93
|
if query
|
94
94
|
"?login=#{GHI.login}&token=#{GHI.token}"
|
95
95
|
else
|
96
|
-
{
|
96
|
+
{ "login" => GHI.login, "token" => GHI.token }
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
data/spec/ghi/api_spec.rb
CHANGED
@@ -4,7 +4,7 @@ require "ghi/issue"
|
|
4
4
|
|
5
5
|
ISSUES_YAML = <<-YAML
|
6
6
|
---
|
7
|
-
issues:
|
7
|
+
issues:
|
8
8
|
- number: 1
|
9
9
|
votes: 0
|
10
10
|
created_at: 2009-04-17 14:55:33 -07:00
|
@@ -24,8 +24,8 @@ issues:
|
|
24
24
|
YAML
|
25
25
|
|
26
26
|
ISSUE_YAML = <<-YAML
|
27
|
-
---
|
28
|
-
issue:
|
27
|
+
---
|
28
|
+
issue:
|
29
29
|
number: 1
|
30
30
|
votes: 0
|
31
31
|
created_at: 2009-04-17 14:55:33 -07:00
|
@@ -37,8 +37,8 @@ issue:
|
|
37
37
|
YAML
|
38
38
|
|
39
39
|
LABELS_YAML = <<-YAML
|
40
|
-
---
|
41
|
-
labels:
|
40
|
+
---
|
41
|
+
labels:
|
42
42
|
- testing
|
43
43
|
- test_label
|
44
44
|
YAML
|
@@ -87,10 +87,10 @@ describe GHI::API do
|
|
87
87
|
|
88
88
|
it "should process posts" do
|
89
89
|
url = "http://github.com/api/v2/yaml/issues/open/stephencelis/ghi"
|
90
|
-
query = {
|
91
|
-
|
92
|
-
|
93
|
-
|
90
|
+
query = { "login" => "stephencelis",
|
91
|
+
"token" => "d1cd249db48d51c9847cbf2b291f5ae9",
|
92
|
+
"title" => "Title",
|
93
|
+
"body" => "Body" }
|
94
94
|
@api.stub!(:url).and_return url
|
95
95
|
r = mock(Net::HTTPRequest)
|
96
96
|
r.should_receive(:body).once.and_return ISSUE_YAML
|
@@ -187,7 +187,7 @@ describe GHI::API do
|
|
187
187
|
response = mock(Net::HTTPRequest)
|
188
188
|
response.stub!(:body).and_return COMMENT_YAML
|
189
189
|
Net::HTTP.should_receive(:post_form).with("u",
|
190
|
-
hash_including(
|
190
|
+
hash_including("comment" => "Comment")).and_return response
|
191
191
|
@api.comment(1, "Comment").should be_an_instance_of(Hash)
|
192
192
|
end
|
193
193
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ghi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Celis
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-11-
|
12
|
+
date: 2009-11-30 00:00:00 -06:00
|
13
13
|
default_executable: ghi
|
14
14
|
dependencies: []
|
15
15
|
|