Sha256: 7f2688b776efeb97092bef2c4efdac208c562a0597f07e4ba3e32905f355028c
Contents?: true
Size: 898 Bytes
Versions: 2
Compression:
Stored size: 898 Bytes
Contents
module Teaspoon class CheckCoverage include Teaspoon::Utility def initialize(input) @input = input end def check_coverage do_check_coverage(check_coverage_options.strip) unless check_coverage_options.nil? end private def do_check_coverage(options) result = %x{#{executable} check-coverage #{options} #{@input.shellescape}} raise "Coverage threshold failure (current levels: #{options})" unless $?.exitstatus == 0 result.strip end def check_coverage_options @check_coverage_options ||= %w{statements functions branches lines}.inject("") do |line, coverage_type| threshold = Teaspoon.configuration.send(:"#{coverage_type}_coverage_threshold") line += "--#{coverage_type} #{threshold} " unless threshold.nil? end end def executable @executable ||= which("istanbul") end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
teaspoon-0.7.9 | lib/teaspoon/check_coverage.rb |
teaspoon-0.7.8 | lib/teaspoon/check_coverage.rb |