tests/testthat/helpers-logging.R

expect_file_contains <- function(outfile, regex) {
  expect_true(file.exists(outfile))

  if (file.exists(outfile)) {
    content <- readLines(outfile)

    expect_true(any(grepl(regex, content)))
  }
}
johnmyleswhite/log4r documentation built on Feb. 4, 2023, 9:56 p.m.