Sha256: 22c714731f35a55fa23f87113839e049344b38d42ff67da922e75bf2091e7143
Contents?: true
Size: 1.01 KB
Versions: 17
Compression:
Stored size: 1.01 KB
Contents
module Slather module CoverageService module SimpleOutput def coverage_file_class Slather::CoverageFile end private :coverage_file_class def post total_project_lines = 0 total_project_lines_tested = 0 coverage_files.each do |coverage_file| # ignore lines that don't count towards coverage (comments, whitespace, etc). These are nil in the array. lines_tested = coverage_file.num_lines_tested total_lines = coverage_file.num_lines_testable percentage = '%.2f' % [coverage_file.percentage_lines_tested] total_project_lines_tested += lines_tested total_project_lines += total_lines puts "#{coverage_file.source_file_pathname_relative_to_repo_root}: #{lines_tested} of #{total_lines} lines (#{percentage}%)" end total_percentage = '%.2f' % [(total_project_lines_tested / total_project_lines.to_f) * 100.0] puts "Test Coverage: #{total_percentage}%" end end end end
Version data entries
17 entries across 17 versions & 2 rubygems