If you call `expect_error(error_with_class(), "text")` testthat should warn that it's better to use `class`.