Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

class method

Coverage.result

(?stop: ::boolish, ?clear: ::boolish) -> ::Hash[::String, untyped]
Coverage.result(stop: true, clear: true) => hash

Returns a hash that contains filename as key and coverage array as value. If clear is true, it clears the counters to zero. If stop is true, it disables coverage measurement.

See also .peek_result .resume .line_stub .running? also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0