From 71b4a02b05220f8234d4396b555c912abdf59f7d Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Wed, 14 Apr 2021 12:42:11 +0200 Subject: [PATCH] more corrections --- lib/github_check_run_service.rb | 3 ++- lib/index.rb | 2 +- spec/github_check_run_service_spec.rb | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/github_check_run_service.rb b/lib/github_check_run_service.rb index b2287cf..878d81e 100644 --- a/lib/github_check_run_service.rb +++ b/lib/github_check_run_service.rb @@ -1,9 +1,10 @@ # frozen_string_literal: true class GithubCheckRunService - def initialize(report, github_data, report_adapter) + def initialize(report, github_data, report_name, report_adapter) @report = report @github_data = github_data + @report_name = report_name @report_adapter = report_adapter @client = GithubClient.new(@github_data[:token], user_agent: 'coverage-action') end diff --git a/lib/index.rb b/lib/index.rb index 3e4e029..0b2e64c 100644 --- a/lib/index.rb +++ b/lib/index.rb @@ -27,4 +27,4 @@ end @report = CoverageReport.generate(@coverage_type, @report_path, @data) -GithubCheckRunService.new(@report, @github_data, ReportAdapter).run +GithubCheckRunService.new(@report, @github_data, @report_name, ReportAdapter).run diff --git a/spec/github_check_run_service_spec.rb b/spec/github_check_run_service_spec.rb index b76cb51..036a85e 100644 --- a/spec/github_check_run_service_spec.rb +++ b/spec/github_check_run_service_spec.rb @@ -7,7 +7,8 @@ describe GithubCheckRunService do { 'lines' => { 'covered_percent' => 80, 'minumum_percent' => 80 } } end 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 stub_request(:any, 'https://api.github.com/repos/owner/repository_name/check-runs/id')