Sha256: 20c21630c26b9273d263a9d0d2589625aa7133986770a8211194d0799eeacc0b

Contents?: true

Size: 680 Bytes

Versions: 1

Compression:

Stored size: 680 Bytes

Contents

def initialize(context)
	super
	
	require_relative '../../lib/covered/policy/default'
end

# Validate the coverage of multiple test runs.
# @parameter paths [Array(String)] The coverage database paths.
# @parameter minumum [Float] The minimum required coverage in order to pass.
def validate(paths: nil, minimum: 1.0)
	paths&.each do |path|
		# It would be nice to have a better algorithm here than just ignoring mtime - perhaps using checksums?
		Covered::Persist.new($covered.output, path).load!(ignore_mtime: true)
	end
	
	$covered.flush
	
	statistics = Covered::Statistics.new
	
	$covered.each do |coverage|
		statistics << coverage
	end
	
	statistics.validate!(minimum)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
covered-0.15.2 bake/covered/validate.rb