Check that current is an S4 object that is of class class
expect_s4_class(current, class, ..., info = NA_character_)A tinytest object. A tinytest object is a
logical with attributes holding information about the
test that was run
testthat equivalent:
testthat::expect_s4_class()
Other typing expectation predicates:
expect_s3_class(),
expect_type()
expect_s4_class(Matrix::Matrix(), "Matrix") # Pass
#> ----- PASSED : <-->
#> call| expect_s4_class(Matrix::Matrix(), "Matrix")
expect_s4_class(data.frame(), "data.frame") # Fail
#> ----- FAILED[attr]: <-->
#> call| expect_s4_class(data.frame(), "data.frame")
#> diff| Expected an S4 object, got a non-S4 object
expect_s4_class(data.frame(), NA) # Pass
#> ----- PASSED : <-->
#> call| expect_s4_class(data.frame(), NA)