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