assert_inherits: Assert inherits

View source: R/type-assertions.R

assert_inheritsR Documentation

Assert inherits

Description

Raises an assertion error when !inherits(obj, class).

Usage

assert_inherits(
  obj,
  class,
  error_message = "{.arg obj} must inherit {.cls {class}}",
  error_class = NULL
)

Arguments

obj

<any> any value

class

<string | character> the expected class(es)

error_message

<string> a message to be displayed when assertion fails.

error_class

<character> the class name/s for the error.

See Also

Other type-assertions: assert_is_character(), assert_is_double(), assert_is_integerish(), assert_is_integer(), assert_is_logical(), assert_is_numeric(), assert_is_raw(), assert_is_typeof()


qfes/tidyassert documentation built on March 19, 2022, 7:18 a.m.