Skip to content

Commit 7558134

Browse files
committed
reuse covered percent further and round the covered strength
1 parent 92ebc37 commit 7558134

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

views/file_list.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<span><b><%= source_files.total_branches %></b> total branches, </span>
3232
<span class="green"><b><%= source_files.covered_branches %></b> branches covered</span> and
3333
<span class="red"><b><%= source_files.missed_branches %></b> branches missed.</span>
34-
(<%= covered_percent(source_files.branches_coverage_percent) %>)
34+
(<%= covered_percent(source_files.branch_covered_percent) %>)
3535
</div>
3636
<% end %>
3737

@@ -62,7 +62,7 @@
6262
<td><%= source_file.covered_lines.count + source_file.missed_lines.count %></td>
6363
<td><%= source_file.covered_lines.count %></td>
6464
<td><%= source_file.missed_lines.count %></td>
65-
<td><%= source_file.covered_strength %></td>
65+
<td><%= source_file.covered_strength.round(2) %></td>
6666
<% if branchable_result? %>
6767
<td class="<%= coverage_css_class(source_file.branches_coverage_percent) %> strong t-file__branch-coverage"><%= source_file.branches_coverage_percent.round(2).to_s %> %</td>
6868
<td><%= source_file.total_branches.count %></td>

views/source_file.erb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,13 @@
22
<div class="header">
33
<h3><%= shortened_filename source_file %></h3>
44
<h4>
5-
<span class="<%= coverage_css_class(source_file.covered_percent) %>">
6-
<%= source_file.covered_percent.round(2).to_s %> %
7-
</span>
5+
<%= covered_percent(source_file.covered_percent) %>
86
lines covered
97
</h4>
108

119
<% if branchable_result? %>
1210
<h4>
13-
<span class="<%= coverage_css_class(source_file.branches_coverage_percent) %>">
14-
<%= source_file.branches_coverage_percent.round(2).to_s %> %
15-
</span>
11+
<%= covered_percent(source_file.branches_coverage_percent) %>
1612
branches covered
1713
</h4>
1814
<% end %>

0 commit comments

Comments
 (0)