Skip to content

assert_that failure for inherits on multiple classes fails #73

@MichaelChirico

Description

@MichaelChirico
assert_that(inherits(NULL, c("a", "b")))
Error in stop(assertError(attr(res, "msg"))) : bad error message

The issue is here, where what is assumed length-1:

assertthat/R/base-is.r

Lines 45 to 49 in 50dc4b0

# Catch all
base_fs$inherits <- function(call, env) {
class <- eval(call$what, env)
paste0(deparse(call$x), " does not inherit from class ", class)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions