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.peek_result

() -> ::Hash[::String, untyped]
Coverage.peek_result => hash

Returns a hash that contains filename as key and coverage array as value. This is the same as Coverage.result(stop: false, clear: false).

{
  "file.rb" => [1, 2, nil],
  ...
}
See also .line_stub .result .resume also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0