Skip to content

Commit 5233ec6

Browse files
committed
simplify the tests for bookdown_yml_arg() after faa25ee27edd88d683411406f68530162fccce03
1 parent 754ee46 commit 5233ec6

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

tests/testit/test-utils.R

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -119,19 +119,11 @@ assert('lua_filter() works as expected', {
119119
(basename(lua_filter("custom-environment.lua")) %==% "custom-environment.lua")
120120
})
121121

122-
assert('_bookdown-meta is generated to be found by pandoc', {
123-
if (pandoc2.0()) {
124-
dir.create(project <- tempfile())
125-
old = setwd(project)
126-
("--metadata-file" %in% bookdown_yml_arg())
127-
(xfun::in_dir(tempdir(), file.exists("_bookdown-meta.yml")))
128-
# clean tests
129-
unlink(project, recursive = TRUE); rm(project)
130-
setwd(old); rm(old)
131-
} else {
132-
bookdown_yml_arg() %==% NULL
133-
}
134-
TRUE
122+
if (pandoc2.0()) assert("bookdown_yml_arg() passes _bookdown.yml to Pandoc as the 'bookdown' field", {
123+
p = tempfile(); d = list(book_filename = 'cool'); a = bookdown_yml_arg(d, p)
124+
("--metadata-file" %in% a)
125+
(yaml::read_yaml(p) %==% list(bookdown = d))
126+
unlink(p)
135127
})
136128

137129
assert('convert engine to fenced divs', {

0 commit comments

Comments
 (0)