BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
3e481f15
Commit
3e481f15
authored
Aug 11, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add metadata and template methods for coverage badge
parent
dbb9d6a7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
report.rb
lib/gitlab/badge/coverage/report.rb
+8
-0
report_spec.rb
spec/lib/gitlab/badge/coverage/report_spec.rb
+12
-0
No files found.
lib/gitlab/badge/coverage/report.rb
View file @
3e481f15
...
@@ -29,6 +29,14 @@ module Gitlab
...
@@ -29,6 +29,14 @@ module Gitlab
@coverage
.
to_i
@coverage
.
to_i
end
end
def
metadata
@metadata
||=
Coverage
::
Metadata
.
new
(
self
)
end
def
template
@template
||=
Coverage
::
Template
.
new
(
self
)
end
private
private
def
raw_coverage
def
raw_coverage
...
...
spec/lib/gitlab/badge/coverage/report_spec.rb
View file @
3e481f15
...
@@ -14,6 +14,18 @@ describe Gitlab::Badge::Coverage::Report do
...
@@ -14,6 +14,18 @@ describe Gitlab::Badge::Coverage::Report do
end
end
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
shared_examples
'unknown coverage report'
do
context
'particular job specified'
do
context
'particular job specified'
do
let
(
:job_name
)
{
''
}
let
(
:job_name
)
{
''
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment