@@ -278,7 +278,7 @@ expect_condition_matching <- function(base_class,
278278 )
279279
280280 expected <- ! identical(regexp , NA )
281- msg <- compare_condition_3e(base_class , act $ cap , act $ lab , expected )
281+ msg <- compare_condition_3e(base_class , class , act $ cap , act $ lab , expected )
282282
283283 # Access error fields with `[[` rather than `$` because the
284284 # `$.Throwable` from the rJava package throws with unknown fields
@@ -375,10 +375,14 @@ capture_matching_condition <- function(expr, matches) {
375375
376376# Helpers -----------------------------------------------------------------
377377
378- compare_condition_3e <- function (cond_type , cond , lab , expected ) {
378+ compare_condition_3e <- function (cond_type , cond_class , cond , lab , expected ) {
379379 if (expected ) {
380380 if (is.null(cond )) {
381- sprintf(" %s did not throw the expected %s." , lab , cond_type )
381+ if (is.null(cond_class )) {
382+ sprintf(" %s did not throw the expected %s." , lab , cond_type )
383+ } else {
384+ sprintf(" %s did not throw a %s with class <%s>." , lab , cond_type , cond_class )
385+ }
382386 } else {
383387 NULL
384388 }
0 commit comments