| test_theme <- function(theme) { |
| test_that(paste(theme, "theme"), { |
| # don't run on cran because pandoc is required |
| # work in a temp directory |
| on.exit(setwd(oldwd), add = TRUE) |
| # create a draft of a presentation |
| rmarkdown::draft(testdoc, |
| system.file("rmarkdown", "templates", "revealjs_presentation", |
| # render it with the specified theme |
| output_file <- tempfile(fileext = ".html") |
| output_format <- revealjs_presentation(theme = theme) |
| rmarkdown::render(testdoc, |
| output_format = output_format, |
| output_file = output_file, |
| expect_true(file.exists(output_file)) |
| sapply(revealjs:::revealjs_themes(), test_theme) |