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 +4 -4
- data/lib/cc/presenters/pull_requests_presenter.rb +4 -6
- data/lib/cc/services/version.rb +1 -1
- data/spec/cc/presenters/pull_requests_presenter_spec.rb +5 -5
- data/spec/cc/service/github_pull_requests_spec.rb +3 -3
- data/spec/cc/service/gitlab_merge_requests_spec.rb +2 -2
- data/spec/cc/service/stash_pull_requests_spec.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b11c82863c3fe8d7abd190d5d8d1605232348a2
|
4
|
+
data.tar.gz: 7953aafa98f5ff37f3752d6bc0695b35a265a9d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
52
|
-
"#{@new_count}
|
53
|
-
elsif @
|
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
|
-
"
|
56
|
+
"All good!"
|
59
57
|
end
|
60
58
|
end
|
61
59
|
|
data/lib/cc/services/version.rb
CHANGED
@@ -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
|
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
|
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
|
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("
|
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
|
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
|
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
|
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" =>
|
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
|
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
|
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
|
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
|
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.
|
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-
|
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.
|
241
|
+
rubygems_version: 2.4.5
|
242
242
|
signing_key:
|
243
243
|
specification_version: 4
|
244
244
|
summary: Service classes for Code Climate
|