https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112018-12-25T12:30:21ZRuby Issue Tracking SystemRuby master - Feature #15463: oneshot coverage does not allow counting code lines without coveragehttps://bugs.ruby-lang.org/issues/15463?journal_id=758842018-12-25T12:30:21Zgrosser (Michael Grosser)michael@grosser.it
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/75884/diff?detail_id=50744">diff</a>)</li></ul> Ruby master - Feature #15463: oneshot coverage does not allow counting code lines without coveragehttps://bugs.ruby-lang.org/issues/15463?journal_id=758862018-12-25T12:52:25Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul></ul><p>Thank you for playing with oneshot coverage. You may want to use <code>Coverage.line_stub</code>.</p>
<pre><code>$ cat t.rb
# Foo
def a
1
end
</code></pre>
<pre><code>$ ruby -rcoverage -e 'p Coverage.line_stub("t.rb")'
[nil, 0, 0, nil]
</code></pre>
<p><code>nil</code> means that the corresponding line is uncoverable. <code>0</code> means that the corresponding line is coverable (lines ruby considers code).</p>