tests/testthat/test_add_captions.R

test_that("function add_captions works", {
  temp_dir <- tempdir()
  add_captions(
    from = file.path("..", "testdata", "test_captions.Rmd"),
    to = file.path(temp_dir, "step1.Rmd")
  )
  add_captions(
    from = file.path(temp_dir, "step1.Rmd"),
    to = file.path(temp_dir, "final_result.Rmd"),
    name_figure_from = "foto"
  )
  expect_equal(
    readLines(file.path(temp_dir, "final_result.Rmd")),
    readLines(file.path("..", "testdata", "result_captions.Rmd"))
  )
})
inbo/protocolshelper documentation built on Sept. 6, 2024, 9:15 p.m.