context("test-themes") test_theme_file <- function(theme = "duo") { theme_fun <- switch( theme, "duo" = duo, "duo_accent" = duo_accent, "duo_accent_inverse" = duo_accent_inverse, "mono_accent" = mono_accent, "mono_accent_inverse" = mono_accent_inverse, "mono_dark" = mono_dark, "mono_light" = mono_light, "solarized_dark" = solarized_dark, "solarized_light" = solarized_light, stop("Unknown theme") ) tmpfile <- tempfile() theme_file <- paste0(theme, ".css") theme_fun(outfile = tmpfile) theme_css <- paste(readLines(tmpfile), collapse = "\n") expect_known_output(cat(theme_css), test_path("css", theme_file)) } test_that("duo()", test_theme_file("duo")) test_that("duo_accent()", test_theme_file("duo_accent")) test_that("duo_accent_inverse()", test_theme_file("duo_accent_inverse")) test_that("mono_accent()", test_theme_file("mono_accent")) test_that("mono_accent_inverse()", test_theme_file("mono_accent_inverse")) test_that("mono_dark()", test_theme_file("mono_dark")) test_that("mono_light()", test_theme_file("mono_light")) test_that("solarized_dark()", test_theme_file("solarized_dark")) test_that("solarized_light()", test_theme_file("solarized_light"))