From 87f08366ed25a00f6bd06ac25c7af95374eb68a6 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Fri, 6 Dec 2024 14:57:56 -0800 Subject: [PATCH] Fix unit test (don't try to install pandoc 3.1.2 in test) --- tests/testthat/test-update-csasstyle.R | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/tests/testthat/test-update-csasstyle.R b/tests/testthat/test-update-csasstyle.R index 1ffc5ed..0d1175a 100644 --- a/tests/testthat/test-update-csasstyle.R +++ b/tests/testthat/test-update-csasstyle.R @@ -33,18 +33,20 @@ test_that("update_csasstyle() works", { # --------------------------------------------------------------------------- # Set lot_lof (toggle show List of tables/List of Figures in doc) installed_3_1_2 <- pandoc::pandoc_available("3.1.2") - if(!installed_3_1_2){ - pandoc::pandoc_install("3.1.2") - } - pandoc::pandoc_activate("3.1.2") - rmd <- readLines("index.Rmd") - ind <- grep("lot_lof:", rmd) - rmd[ind] <- " lot_lof: true" - writeLines(rmd, "index.Rmd") - csasdown::render() - expect_true(file.exists("_book/resdoc-english.pdf")) - if(!installed_3_1_2){ - pandoc::pandoc_uninstall("3.1.2") + if (installed_3_1_2) { + # if (!installed_3_1_2){ + # pandoc::pandoc_install("3.1.2") + # } + pandoc::pandoc_activate("3.1.2") + rmd <- readLines("index.Rmd") + ind <- grep("lot_lof:", rmd) + rmd[ind] <- " lot_lof: true" + writeLines(rmd, "index.Rmd") + csasdown::render() + expect_true(file.exists("_book/resdoc-english.pdf")) + # if (!installed_3_1_2){ + # pandoc::pandoc_uninstall("3.1.2") + # } } # ---------------------------------------------------------------------------