Skip to content

Commit

Permalink
Fix unit test (don't try to install pandoc 3.1.2 in test)
Browse files Browse the repository at this point in the history
  • Loading branch information
seananderson committed Dec 6, 2024
1 parent b58ca17 commit 87f0836
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions tests/testthat/test-update-csasstyle.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
# }
}

# ---------------------------------------------------------------------------
Expand Down

0 comments on commit 87f0836

Please sign in to comment.