Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
Coverage.supported?
Coverage.supported?(mode) → true or false
ext/coverage/coverage.c
View on GitHub ↗
static VALUE
rb_coverage_supported(VALUE self, VALUE _mode)
{
ID mode = RB_SYM2ID(_mode);
return RBOOL(
mode == rb_intern("lines") ||
mode == rb_intern("oneshot_lines") ||
mode == rb_intern("branches") ||
mode == rb_intern("methods") ||
mode == rb_intern("eval")
);
}
Returns true if coverage measurement is supported for the given mode.
The mode should be one of the following symbols: :lines, :oneshot_lines, :branches, :methods, :eval.
Example:
Example
Coverage.supported?(:lines) #=> true Coverage.supported?(:all) #=> false