BigW Consortium Gitlab

Commit 3e481f15 by Grzegorz Bizon

Add metadata and template methods for coverage badge

parent dbb9d6a7
......@@ -29,6 +29,14 @@ module Gitlab
@coverage.to_i
end
def metadata
@metadata ||= Coverage::Metadata.new(self)
end
def template
@template ||= Coverage::Template.new(self)
end
private
def raw_coverage
......
......@@ -14,6 +14,18 @@ describe Gitlab::Badge::Coverage::Report do
end
end
describe '#metadata' do
it 'returns correct metadata' do
expect(badge.metadata.image_url).to include 'coverage.svg'
end
end
describe '#template' do
it 'returns correct template' do
expect(badge.template.key_text).to eq 'coverage'
end
end
shared_examples 'unknown coverage report' do
context 'particular job specified' do
let(:job_name) { '' }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment