Skip to content

Commit e484665

Browse files
Merge pull request #132 from JoshuaSturm/print_description_assert_errors
Print description in assert error summary
2 parents b4536a0 + 5acd465 commit e484665

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# assertr development version
22

3+
* Assert errors now print the description in the error summary (PR #132)
4+
35
* Added the ability to check non-numeric classes with `within_bounds()`
46
(fix #89)
57

R/errors.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ print.assertr_defect <- function(x, ...){
148148
#'
149149
#' @export
150150
summary.assertr_assert_error <- function(object, ...){
151+
if (!is.na(object$description)) {
152+
cat(object$description)
153+
cat("\n")
154+
}
151155
cat(object$message)
152156
cat("\n")
153157
numrows <- nrow(object$error_df)

0 commit comments

Comments
 (0)