swh:1:snp:bdc19e867479541d0f4994ceaa711217d0dc28ed
Tip revision: 1ad2332a4119217014f512bdf05025fa6f2bb72f authored by Hadley Wickham on 09 April 2020, 13:00:02 UTC
version 1.5.1
version 1.5.1
Tip revision: 1ad2332
test-rmarkdown.R
test_that("render_rmarkdown copies image files in subdirectories", {
skip_if_no_pandoc()
tmp <- dir_create(file_temp())
pkg <- list(src_path = test_path(), dst_path = tmp)
expect_output(
render_rmarkdown(pkg, "assets/vignette-with-img.Rmd", "test.html")
)
expect_equal(
path_rel(dir_ls(tmp, type = "file", recurse = TRUE), tmp),
c("open-graph/logo.png", "test.html")
)
})
test_that("render_rmarkdown yields useful error", {
skip_if_no_pandoc()
tmp <- dir_create(file_temp())
pkg <- list(src_path = test_path(), dst_path = tmp)
verify_output(test_path("test-rmarkown-error.txt"), {
render_rmarkdown(pkg, "assets/pandoc-fail.Rmd", "test.html")
})
})