Sha256: 647a203101f993550c2bfc6d0043012aad1ebb42c3698d8a3d3a402f931e5364

Contents?: true

Size: 919 Bytes

Versions: 1

Compression:

Stored size: 919 Bytes

Contents

# Ensure we are using a compatible version of SimpleCov
if Gem::Version.new(SimpleCov::VERSION) < Gem::Version.new("0.8.0")
  raise RuntimeError, 'The version of SimpleCov you are using is too old. Please update with `gem install simplecov` or `bundle update simplecov`'
end

module SimpleCov::Formatter
  class TeamcitySummaryFormatter
    def format(simplecov_results)
      puts format_teamcity(simplecov_results)
    end

    def format_teamcity(simplecov_results)
      <<-eos

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageL' value='#{simplecov_results.covered_percent}']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='#{simplecov_results.covered_lines}']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='#{simplecov_results.total_lines}']
##teamcity[blockClosed name='Code Coverage Summary']
      eos
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
simplecov-teamcity-summary-0.1.1 lib/simplecov-teamcity-summary/formatter.rb