Coverage.supported? recognizes oneshot_lines mode (#7040)

This adds oneshot_lines as a mode of coverage that is supported.
This commit is contained in:
Kevin Murphy 2022-12-29 03:23:25 -05:00 коммит произвёл GitHub
Родитель cada537040
Коммит b3d330c39e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -29,7 +29,7 @@ static VALUE me2counter = Qnil;
* Returns true if coverage measurement is supported for the given mode.
*
* The mode should be one of the following symbols:
* +:lines+, +:branches+, +:methods+, +:eval+.
* +:lines+, +:oneshot_lines+, +:branches+, +:methods+, +:eval+.
*
* Example:
*
@ -43,6 +43,7 @@ rb_coverage_supported(VALUE self, VALUE _mode)
return RBOOL(
mode == rb_intern("lines") ||
mode == rb_intern("oneshot_lines") ||
mode == rb_intern("branches") ||
mode == rb_intern("methods") ||
mode == rb_intern("eval")

Просмотреть файл

@ -174,6 +174,7 @@ class TestCoverage < Test::Unit::TestCase
def test_coverage_supported
assert Coverage.supported?(:lines)
assert Coverage.supported?(:oneshot_lines)
assert Coverage.supported?(:branches)
assert Coverage.supported?(:methods)
assert Coverage.supported?(:eval)