CoveredSourceCoveredForksHandler

module Handler

Handles Process.fork so child processes record coverage independently.

Nested

Definitions

def _fork

Intercept Process.fork and initialize coverage in the child.

Signature

returns Integer | Nil

The process ID in the parent, and 0 or nil in the child depending on Ruby's fork semantics.

Implementation

def _fork
	pid = super
	
	if pid.zero?
		Handler.after_fork
	end
	
	return pid
end