more corrections
This commit is contained in:
parent
8d4f7c6ab3
commit
71b4a02b05
@ -1,9 +1,10 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class GithubCheckRunService
|
class GithubCheckRunService
|
||||||
def initialize(report, github_data, report_adapter)
|
def initialize(report, github_data, report_name, report_adapter)
|
||||||
@report = report
|
@report = report
|
||||||
@github_data = github_data
|
@github_data = github_data
|
||||||
|
@report_name = report_name
|
||||||
@report_adapter = report_adapter
|
@report_adapter = report_adapter
|
||||||
@client = GithubClient.new(@github_data[:token], user_agent: 'coverage-action')
|
@client = GithubClient.new(@github_data[:token], user_agent: 'coverage-action')
|
||||||
end
|
end
|
||||||
|
|||||||
@ -27,4 +27,4 @@ end
|
|||||||
|
|
||||||
@report = CoverageReport.generate(@coverage_type, @report_path, @data)
|
@report = CoverageReport.generate(@coverage_type, @report_path, @data)
|
||||||
|
|
||||||
GithubCheckRunService.new(@report, @github_data, ReportAdapter).run
|
GithubCheckRunService.new(@report, @github_data, @report_name, ReportAdapter).run
|
||||||
|
|||||||
@ -7,7 +7,8 @@ describe GithubCheckRunService do
|
|||||||
{ 'lines' => { 'covered_percent' => 80, 'minumum_percent' => 80 } }
|
{ 'lines' => { 'covered_percent' => 80, 'minumum_percent' => 80 } }
|
||||||
end
|
end
|
||||||
let(:github_data) { { sha: 'sha', token: 'token', owner: 'owner', repo: 'repository_name' } }
|
let(:github_data) { { sha: 'sha', token: 'token', owner: 'owner', repo: 'repository_name' } }
|
||||||
let(:service) { GithubCheckRunService.new(report, github_data, ReportAdapter) }
|
let(:report_name) { 'Coverage' }
|
||||||
|
let(:service) { GithubCheckRunService.new(report, github_data, report_name, ReportAdapter) }
|
||||||
|
|
||||||
it '#run' do
|
it '#run' do
|
||||||
stub_request(:any, 'https://api.github.com/repos/owner/repository_name/check-runs/id')
|
stub_request(:any, 'https://api.github.com/repos/owner/repository_name/check-runs/id')
|
||||||
|
|||||||
Reference in New Issue
Block a user