I have a simple print function in an R package:
print.tabyl <- function(x){
print.data.frame(x, row.names = FALSE)
}
I'm trying to achieve full test coverage of my package and it annoys me that my untested print function lowers my test coverage to 99% (it would be 100% otherwise).
But I can't figure out how to capture of the output of the print function in order to write a test for it. How can I write a test for a print function?