Skip to content

Commit

Permalink
first stab at print method
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmusab committed Nov 11, 2017
1 parent e2cd779 commit 4c87fea
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions R/reporter-project.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,23 @@ ProjectReporter <- R6::R6Class("ProjectReporter", inherit = testthat::ListReport
message = message,
success = success,
outcome = outcome)
},
print = function() {
end_report <- self$end_reporter()
summary <- end_report$summary
tests <- do.call(rbind, lapply(end_report$tests, data.frame, stringsAsFactors=FALSE))
tests <- tests[ ! tests$success, ]
tests <- end_report$tests
cat("Tests:", summary$tests, ", Failures:", summary$failures, ", Errors: ", summary$errors, sep = "")
cat("\n")
for(i in seq_along(tests)) {
test <- tests[[i]]
if(test$success) next
cat(">", test$outcome, "::", test$name)
cat("\n")
cat( test$message, "\n---\n")
}
invisible(self)
}
),
private = list(
Expand Down

0 comments on commit 4c87fea

Please sign in to comment.