expect_is: Expectation: does the object inherit from a given class?

Description Usage Arguments

View source: R/expect-inheritance.R

Description

expect_is() is an older form that uses inherits() without checking whether x is S3, S4, or neither. Intead, I'd recommend using expect_type(), expect_s3_class() or expect_s4_class() to more clearly convey your intent.

Usage

1
expect_is(object, class, info = NULL, label = NULL)

Arguments

object

Object to test.

Supports limited unquoting to make it easier to generate readable failures within a function or for loop. See quasi_label for more details.

class

character vector of class names


testthat documentation built on Dec. 1, 2019, 5:06 p.m.