is_a(class) expect_is(object, class, info = NULL, label = NULL)
NULL
, computed
from deparsed object.inherits
Other expectations: equals
,
expect_equal
,
expect_equivalent
,
expect_error
, expect_false
,
expect_identical
,
expect_match
, expect_message
,
expect_output
, expect_true
,
expect_warning
,
gives_warning
,
is_equivalent_to
, is_false
,
is_identical_to
, is_true
,
matches
, prints_text
,
shows_message
,
takes_less_than
, throws_error
expect_that(1, is_a("numeric"))
a <- matrix(1:10, nrow = 5)
expect_that(a, is_a("matrix"))
expect_that(mtcars, is_a("data.frame"))
expect_is(mtcars, "data.frame")
# alternatively for classes that have an is method
expect_that(is.data.frame(mtcars), is_true())
# doesn't read quite as nicely
Run the code above in your browser using DataLab