-
Notifications
You must be signed in to change notification settings - Fork 341
Closed
Description
Drop use of expect() in favour of an if statement that branches to fail(). Every expectation should call succeed() before returning the value.
In most cases, will want to treat fail() like an early return, i.e. instead of
expect_no_success <- function(expr) {
exp <- capture_success(expr)
if (!is.null(exp)) {
fail("Expectation succeeded")
} else {
succeed()
}
invisible(NULL)
}Should be
expect_no_success <- function(expr) {
exp <- capture_success(expr)
if (!is.null(exp)) {
fail("Expectation succeeded")
}
succeed()
invisible(NULL)
}And then update the documentation in the custom expectations vignette.
Metadata
Metadata
Assignees
Labels
No labels