codeclimate-services 0.5.3 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c0953fb6f745aaa9fa56caa30fc3fd484d2f5172
4
- data.tar.gz: 276e80b44c4c5116a756f0ea8e538f60ce5bfbb9
3
+ metadata.gz: d4ad5ef56a6846466989a540dc698566b62e95eb
4
+ data.tar.gz: f65b4ce96879f5a071ad2da20cd212aad7888ccd
5
5
  SHA512:
6
- metadata.gz: f6777327c22c94a3193ff2b9d36f63fd71045d6e8d06904cb82d6c065c967e6c73a68bc1d4a162fdabdf43c8057d09acfb269452bdfe83946fe0ed61921211e3
7
- data.tar.gz: 9dba79031e807e6b6a156a4ccc3ff7c176a1ef8e6c4655f1efb0e5d3b0881a820e7e5e1ffa208e8a11de4bed6f4c61498d69302ffd1503e6346a4c9f0d26af7a
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: "codeclimate"
111
+ context: config.context,
108
112
  }
109
113
  @response = service_post(status_url, params.to_json)
110
114
  end
@@ -1,5 +1,5 @@
1
1
  module CC
2
2
  module Services
3
- VERSION = "0.5.3"
3
+ VERSION = "0.6.0"
4
4
  end
5
5
  end
@@ -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.5.3
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: 2015-11-03 00:00:00.000000000 Z
11
+ date: 2016-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday