tests/testthat/test_default_functions.R
raw| 1 | context("default_functions") |
| 2 | |
| 3 | |
| 4 | test_that("default_functions works as expected", { |
| 5 | lg <- get_logger("a/test/logger") |
| 6 | lg$set_exception_handler(function(e) e) |
| 7 | |
| 8 | x <- lg$info(stop("blahblah")) |
| 9 | expect_warning(default_exception_handler(x), class = "LoggerWarning") |
| 10 | |
| 11 | x$appender <- AppenderConsole$new() |
| 12 | expect_warning(default_exception_handler(x), class = "AppenderWarning") |
| 13 | expect_warning(default_exception_handler(x), class = "LoggerWarning") |
| 14 | }) |