Skip to content

Commit

Permalink
Merge pull request #125 from cntral/put_coverage_percentage_first
Browse files Browse the repository at this point in the history
Improve clarity of line and branch coverage format.
  • Loading branch information
amatsuda authored Sep 2, 2024
2 parents a10a3a9 + e2b0025 commit f6dc4ab
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/simplecov-html.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ def format(result)
end

def output_message(result)
str = "Coverage report generated for #{result.command_name} to #{output_path}. #{result.covered_lines} / #{result.total_lines} LOC (#{result.covered_percent.round(2)}%) covered."
str += " #{result.covered_branches} / #{result.total_branches} branches (#{result.coverage_statistics[:branch].percent.round(2)}%) covered." if branchable_result?
str
output = "Coverage report generated for #{result.command_name} to #{output_path}."
output += "\nLine Coverage: #{result.covered_percent.round(2)}% (#{result.covered_lines} / #{result.total_lines})"
output += "\nBranch Coverage: #{result.coverage_statistics[:branch].percent.round(2)}% (#{result.covered_branches} / #{result.total_branches})" if branchable_result?
output
end

def branchable_result?
Expand Down

0 comments on commit f6dc4ab

Please sign in to comment.