Running ‘testthat.R’ [23s/19s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(WordR)
  > 
  > test_check("WordR")
  ── 1. Error: Rendering inline code (@tests.R#3)  ───────────────────────────────
  Could not write '/home/hornik/tmp/R.check/r-devel-gcc/Work/build/Packages/WordR/examples/results/result1.docx' [Can't open zip file]
  1: expect_equal(renderInlineCode(paste(examplePath(), "templates/template1.docx", sep = "/"), 
         paste(examplePath(), "results/result1.docx", sep = "/"), debug = F), paste(examplePath(), 
         "results/result1.docx", sep = "/")) at testthat/tests.R:3
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: renderInlineCode(paste(examplePath(), "templates/template1.docx", sep = "/"), paste(examplePath(), 
         "results/result1.docx", sep = "/"), debug = F)
  5: print(doc, target = docxOut)
  6: print.rdocx(doc, target = docxOut)
  7: pack_folder(folder = x$doc_obj$package_dirname(), target = target)
  8: tryCatch(zip::zip(zipfile = target, files = list.files(all.files = TRUE, recursive = TRUE)), 
         error = function(e) {
             stop("Could not write ", shQuote(target), " [", e$message, "]")
         }, finally = {
             setwd(curr_wd)
         })
  9: tryCatchList(expr, classes, parentenv, handlers)
  10: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  11: value[[3L]](cond)
  12: stop("Could not write ", shQuote(target), " [", e$message, "]")
  
  ── 2. Error: addFlexTables (@tests.R#10)  ──────────────────────────────────────
  writeDoc: Cannot write to /home/hornik/tmp/R.check/r-devel-gcc/Work/build/Packages/WordR/examples/results/resultFT.docx
  1: expect_equal({
         library(ReporteRs)
         ft_mtcars <- vanilla.table(mtcars)
         ft_iris <- vanilla.table(iris)
         FT <- list(ft_mtcars = ft_mtcars, ft_iris = ft_iris)
         addFlexTables(paste(examplePath(), "templates/templateFT.docx", sep = "/"), paste(examplePath(), 
             "results/resultFT.docx", sep = "/"), FT, debug = F)
     }, paste(examplePath(), "results/resultFT.docx", sep = "/")) at testthat/tests.R:10
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: addFlexTables(paste(examplePath(), "templates/templateFT.docx", sep = "/"), paste(examplePath(), 
         "results/resultFT.docx", sep = "/"), FT, debug = F) at testthat/tests.R:14
  5: ReporteRs::writeDoc(doc, docxOut)
  6: writeDoc.docx(doc, docxOut)
  7: stop("writeDoc: Cannot write to ", file)
  
  ── 3. Error: addPlots (@tests.R#21)  ───────────────────────────────────────────
  writeDoc: Cannot write to /home/hornik/tmp/R.check/r-devel-gcc/Work/build/Packages/WordR/examples/results/resultPlots.docx
  1: expect_equal({
         library(ggplot2)
         Plots <- list(plot1 = function() plot(hp ~ wt, data = mtcars, col = cyl), plot2 = function() print(ggplot(mtcars, 
             aes(x = wt, y = hp, col = as.factor(cyl))) + geom_point()))
         addPlots(paste(examplePath(), "templates/templatePlots.docx", sep = ""), paste(examplePath(), 
             "results/resultPlots.docx", sep = ""), Plots, debug = F, height = 4)
     }, paste(examplePath(), "results/resultPlots.docx", sep = "")) at testthat/tests.R:21
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: addPlots(paste(examplePath(), "templates/templatePlots.docx", sep = ""), paste(examplePath(), 
         "results/resultPlots.docx", sep = ""), Plots, debug = F, height = 4) at testthat/tests.R:22
  5: ReporteRs::writeDoc(doc, docxOut)
  6: writeDoc.docx(doc, docxOut)
  7: stop("writeDoc: Cannot write to ", file)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 0 SKIPPED: 0 FAILED: 3
  1. Error: Rendering inline code (@tests.R#3) 
  2. Error: addFlexTables (@tests.R#10) 
  3. Error: addPlots (@tests.R#21) 
  
  Error: testthat unit tests failed
  Execution halted