What's a good way to test that an object inherits from multiple classes? expect_s3_class() uses inherits() which tests if the object inherits from one of the classes passed.
Can we add a new expect_s3_classes() ?
# This is expected
testthat::expect_s3_classes(tibble::tibble(), c("tbl_df", "data.frame"))
# This should be a failure?
testthat::expect_s3_classes(tibble::tibble(), c("tbl_df", "data.table"))
Created on 2019-06-15 by the reprex package (v0.3.0)
What's a good way to test that an object inherits from multiple classes?
expect_s3_class()usesinherits()which tests if the object inherits from one of the classes passed.Can we add a new
expect_s3_classes()?Created on 2019-06-15 by the reprex package (v0.3.0)