codeclimate-services 1.9.8 → 1.10.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: cd62622c4effd89f89c9285ec07b7cd2798148b5
4
- data.tar.gz: 746d956aa4ffe90f01b60b138189f3470d0aa824
3
+ metadata.gz: 2b11c82863c3fe8d7abd190d5d8d1605232348a2
4
+ data.tar.gz: 7953aafa98f5ff37f3752d6bc0695b35a265a9d7
5
5
  SHA512:
6
- metadata.gz: e5c2d4cb11d2af026062570d9d7d2cdba70c301fb8f82058538af93c5dae4d5b22d571fe697d3ceb015434770236d6f8e9befbc7f92a4605a01b3092de374ded
7
- data.tar.gz: 13adce202c161bed06e78f28439e375834135b365e307234e5f45f1ccdd0c280d5716aa59ec218452968b2c2f4b0bd4d3c9411f5c75a05a8159267e803afc1f6
6
+ metadata.gz: 73330d3bf0e63289bdb9d40a884782ed6bff091bd455168ff9eb8865abe63f5746c4a7f5fc7506bfcaa41367eb0879d63d0c9db4bc83af33b5eb87504181e580
7
+ data.tar.gz: 0d3a6ba2497993ae7860e7c5772e827c9c48672e7717169459fae0f0c5dee971f320b3207d195ce791cd1d6f8d757d986c2545cb407eb0d1effcdfed1b1fa518
@@ -48,14 +48,12 @@ module CC
48
48
  def success_message
49
49
  if @approved_by
50
50
  approved_message
51
- elsif @new_count > 0 && @fixed_count > 0
52
- "#{@new_count} new #{"issue".pluralize(@new_count)} (#{@fixed_count} fixed)"
53
- elsif @new_count <= 0 && @fixed_count > 0
51
+ elsif @new_count > 0
52
+ "#{@new_count} #{"issue".pluralize(@new_count)} to fix"
53
+ elsif @fixed_count > 0
54
54
  "#{@fixed_count} fixed #{"issue".pluralize(@fixed_count)}"
55
- elsif @new_count > 0 && @fixed_count <= 0
56
- "#{@new_count} new #{"issue".pluralize(@new_count)}"
57
55
  else
58
- "no new or fixed issues"
56
+ "All good!"
59
57
  end
60
58
  end
61
59
 
@@ -1,5 +1,5 @@
1
1
  module CC
2
2
  module Services
3
- VERSION = "1.9.8".freeze
3
+ VERSION = "1.10.0".freeze
4
4
  end
5
5
  end
@@ -3,12 +3,12 @@ require "cc/presenters/pull_requests_presenter"
3
3
  describe CC::Service::PullRequestsPresenter, type: :service do
4
4
  it "message singular" do
5
5
  expect(build_presenter("fixed" => 1, "new" => 1).success_message).
6
- to eq("1 new issue (1 fixed)")
6
+ to eq("1 issue to fix")
7
7
  end
8
8
 
9
9
  it "message plural" do
10
10
  expect(build_presenter("fixed" => 1, "new" => 2).success_message).
11
- to eq("2 new issues (1 fixed)")
11
+ to eq("2 issues to fix")
12
12
  end
13
13
 
14
14
  it "message only fixed" do
@@ -18,12 +18,12 @@ describe CC::Service::PullRequestsPresenter, type: :service do
18
18
 
19
19
  it "message only new" do
20
20
  expect(build_presenter("fixed" => 0, "new" => 3).success_message).
21
- to eq("3 new issues")
21
+ to eq("3 issues to fix")
22
22
  end
23
23
 
24
24
  it "message no new or fixed" do
25
25
  expect(build_presenter("fixed" => 0, "new" => 0).success_message).
26
- to eq("no new or fixed issues")
26
+ to eq("All good!")
27
27
  end
28
28
 
29
29
  it "message coverage same" do
@@ -45,7 +45,7 @@ describe CC::Service::PullRequestsPresenter, type: :service do
45
45
 
46
46
  it "message approved is empty string" do
47
47
  expect(build_presenter({"fixed" => 1, "new" => 1}, { "approved_by" => ""}).success_message).
48
- to eq("1 new issue (1 fixed)")
48
+ to eq("1 issue to fix")
49
49
  end
50
50
 
51
51
  private
@@ -10,7 +10,7 @@ describe CC::Service::GitHubPullRequests, type: :service do
10
10
 
11
11
  it "pull request status success detailed" do
12
12
  expect_status_update("pbrisbin/foo", "abc123", "state" => "success",
13
- "description" => "2 new issues (1 fixed)")
13
+ "description" => "2 issues to fix")
14
14
 
15
15
  receive_pull_request(
16
16
  {},
@@ -22,7 +22,7 @@ describe CC::Service::GitHubPullRequests, type: :service do
22
22
 
23
23
  it "pull request status failure" do
24
24
  expect_status_update("pbrisbin/foo", "abc123", "state" => "failure",
25
- "description" => "2 new issues (1 fixed)")
25
+ "description" => "2 issues to fix")
26
26
 
27
27
  receive_pull_request(
28
28
  {},
@@ -34,7 +34,7 @@ describe CC::Service::GitHubPullRequests, type: :service do
34
34
 
35
35
  it "pull request status success generic" do
36
36
  expect_status_update("pbrisbin/foo", "abc123", "state" => "success",
37
- "description" => /2 new issues \(1 fixed\)/)
37
+ "description" => "2 issues to fix")
38
38
 
39
39
  receive_pull_request({}, github_slug: "pbrisbin/foo",
40
40
  commit_sha: "abc123",
@@ -20,7 +20,7 @@ describe CC::Service::GitlabMergeRequests, type: :service do
20
20
  "hal/hal9000",
21
21
  "abc123",
22
22
  "state" => "success",
23
- "description" => "2 new issues (1 fixed)",
23
+ "description" => "2 issues to fix",
24
24
  )
25
25
 
26
26
  receive_merge_request(
@@ -36,7 +36,7 @@ describe CC::Service::GitlabMergeRequests, type: :service do
36
36
  "hal/hal9000",
37
37
  "abc123",
38
38
  "state" => "failed",
39
- "description" => "2 new issues (1 fixed)",
39
+ "description" => "2 issues to fix",
40
40
  )
41
41
 
42
42
  receive_merge_request(
@@ -31,7 +31,7 @@ describe CC::Service::StashPullRequests, type: :service do
31
31
 
32
32
  it "pull request status success detailed" do
33
33
  expect_status_update("abc123", "state" => "SUCCESSFUL",
34
- "description" => "2 new issues (1 fixed)")
34
+ "description" => "2 issues to fix")
35
35
 
36
36
  receive_pull_request(
37
37
  commit_sha: "abc123",
@@ -41,7 +41,7 @@ describe CC::Service::StashPullRequests, type: :service do
41
41
 
42
42
  it "pull request status failure" do
43
43
  expect_status_update("abc123", "state" => "FAILED",
44
- "description" => "2 new issues (1 fixed)")
44
+ "description" => "2 issues to fix")
45
45
 
46
46
  receive_pull_request(
47
47
  commit_sha: "abc123",
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: 1.9.8
4
+ version: 1.10.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: 2017-06-29 00:00:00.000000000 Z
11
+ date: 2017-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -238,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
238
  version: '0'
239
239
  requirements: []
240
240
  rubyforge_project:
241
- rubygems_version: 2.6.11
241
+ rubygems_version: 2.4.5
242
242
  signing_key:
243
243
  specification_version: 4
244
244
  summary: Service classes for Code Climate