Skip to content

Commit

Permalink
Coverage.supported? recognizes oneshot_lines mode (#7040)
Browse files Browse the repository at this point in the history
This adds oneshot_lines as a mode of coverage that is supported.
  • Loading branch information
kevin-j-m committed Dec 29, 2022
1 parent cada537 commit b3d330c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ext/coverage/coverage.c
Expand Up @@ -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:
*
Expand All @@ -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")
Expand Down
1 change: 1 addition & 0 deletions test/coverage/test_coverage.rb
Expand Up @@ -174,6 +174,7 @@ def test_eval_coverage

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)
Expand Down

0 comments on commit b3d330c

Please sign in to comment.