Просмотр исходного кода

Fix #6 construct write_xaringan_theme using its argument names

tags/v0.2.0
Garrick Aden-Buie 8 лет назад
Родитель
Сommit
65624d823a
2 измененных файлов: 9 добавлений и 2 удалений
  1. +1
    -2
      R/utils.R
  2. +8
    -0
      tests/testthat/test-write_xaringan_theme.R

+ 1
- 2
R/utils.R Просмотреть файл

@@ -72,8 +72,7 @@ choose_dark_or_light <- function(x, black = "#000", white = "#FFF") {
#' @keywords internal
call_write_xaringan_theme <- function() {
paste0("write_xaringan_theme(",
paste(template_variables$variable, collapse = ", "),
", extra_css, outfile",
paste(names(formals(write_xaringan_theme)), collapse = ", "),
")")
}


+ 8
- 0
tests/testthat/test-write_xaringan_theme.R Просмотреть файл

@@ -0,0 +1,8 @@
context("test-write_xaringan_theme")

test_that("write_xaringan_theme() writes to specified outfile", {
tmpfile <- tempfile(fileext = ".css")
expect_equal(duo_accent(outfile = tmpfile), tmpfile)
expect_true(file.exists(tmpfile))
expect_true(grepl("xaringanthemer", readLines(tmpfile)[3]))
})

Загрузка…
Отмена
Сохранить