codeclimate-services 0.5.3 → 0.6.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.
- checksums.yaml +4 -4
- data/lib/cc/services/github_pull_requests.rb +5 -1
- data/lib/cc/services/version.rb +1 -1
- data/test/github_pull_requests_test.rb +26 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4ad5ef56a6846466989a540dc698566b62e95eb
|
4
|
+
data.tar.gz: f65b4ce96879f5a071ad2da20cd212aad7888ccd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74d77f068c03c1cc933e49efa4e0f783d0742d6954993c8014daf32cb6370dd845fb0b6f93aedf7ff65a9fc460101d2ba00ecc6547190c464865768f62f1420c
|
7
|
+
data.tar.gz: 38e70228acb66ed9def892bbb0bcc1eb4b3309ba6cf4d43095f6c0cddfe75651a49372f65b9479210a854973af91e5edbdc5fb1efb334f76c7c22b269427f1ad
|
@@ -15,6 +15,10 @@ class CC::Service::GitHubPullRequests < CC::Service
|
|
15
15
|
label: "Github API Base URL",
|
16
16
|
description: "Base URL for the Github API",
|
17
17
|
default: "https://api.github.com"
|
18
|
+
attribute :context, String,
|
19
|
+
label: "Github Context",
|
20
|
+
description: "The integration name next to the pull request status",
|
21
|
+
default: "codeclimate"
|
18
22
|
|
19
23
|
validates :oauth_token, presence: true
|
20
24
|
end
|
@@ -104,7 +108,7 @@ private
|
|
104
108
|
state: state,
|
105
109
|
description: description,
|
106
110
|
target_url: @payload["details_url"],
|
107
|
-
context:
|
111
|
+
context: config.context,
|
108
112
|
}
|
109
113
|
@response = service_post(status_url, params.to_json)
|
110
114
|
end
|
data/lib/cc/services/version.rb
CHANGED
@@ -253,6 +253,32 @@ class TestGitHubPullRequests < CC::Service::TestCase
|
|
253
253
|
assert receive_test({ add_comment: true, base_url: "http://example.com" })[:ok], "Expected test of pull request to be true"
|
254
254
|
end
|
255
255
|
|
256
|
+
def test_default_context
|
257
|
+
expect_status_update("gordondiggs/ellis", "abc123", {
|
258
|
+
"context" => "codeclimate",
|
259
|
+
"state" => "pending",
|
260
|
+
})
|
261
|
+
|
262
|
+
response = receive_pull_request({ update_status: true }, {
|
263
|
+
github_slug: "gordondiggs/ellis",
|
264
|
+
commit_sha: "abc123",
|
265
|
+
state: "pending",
|
266
|
+
})
|
267
|
+
end
|
268
|
+
|
269
|
+
def test_different_context
|
270
|
+
expect_status_update("gordondiggs/ellis", "abc123", {
|
271
|
+
"context" => "sup",
|
272
|
+
"state" => "pending",
|
273
|
+
})
|
274
|
+
|
275
|
+
response = receive_pull_request({ context: "sup", update_status: true }, {
|
276
|
+
github_slug: "gordondiggs/ellis",
|
277
|
+
commit_sha: "abc123",
|
278
|
+
state: "pending",
|
279
|
+
})
|
280
|
+
end
|
281
|
+
|
256
282
|
private
|
257
283
|
|
258
284
|
def expect_status_update(repo, commit_sha, params)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codeclimate-services
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Helmkamp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|