Skip to content

Commit 00e82fd

Browse files
clarify about fail() paralleling pass()
1 parent d695714 commit 00e82fd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

vignettes/custom-expectation.Rmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ Next you need to check each way that `object` could violate the expectation. In
9696

9797
If the object is as expected, call `pass()`. This ensures that a success will be registered in the test reporter.
9898

99+
Otherwise, call `fail()`. This ensures that a failure will be registered in the test reporter. NB: unlike `stop()` or `abort()`, `fail()` signals a failure but allows code execution to continue, ensuring that one failure does not prevent subsequent expectations from running.
100+
99101
Finally, return the input value (`act$val`) invisibly. This is good practice because expectations are called primarily for their side-effects (triggering a failure), and returning the value allows expectations to be piped together:
100102

101103
```{r}

0 commit comments

Comments
 (0)