[DOC] Document of Coverage.line_stub from NEWS-2.6.0

This commit is contained in:
Nobuyoshi Nakada 2025-11-09 19:09:28 +09:00
parent 4170b70d32
commit 953fee11b3
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465
Notes: git 2025-11-09 13:16:57 +00:00

View File

@ -1,6 +1,11 @@
require "coverage.so"
module Coverage
# call-seq:
# line_stub(file) -> array
#
# A simple helper function that creates the "stub" of line coverage
# from a given source code.
def self.line_stub(file)
lines = File.foreach(file).map { nil }
iseqs = [RubyVM::InstructionSequence.compile_file(file)]