Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
3e481f15
Commit
3e481f15
authored
8 years ago
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add metadata and template methods for coverage badge
parent
dbb9d6a7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
lib/gitlab/badge/coverage/report.rb
lib/gitlab/badge/coverage/report.rb
+8
-0
spec/lib/gitlab/badge/coverage/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
...
...
This diff is collapsed.
Click to expand it.
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
)
{
''
}
...
...
This diff is collapsed.
Click to expand it.
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