Skip to content

Commit a2f4fb8

Browse files
committed
Add test for asa_article
And refactor test_format
1 parent 8ee42a4 commit a2f4fb8

1 file changed

Lines changed: 10 additions & 19 deletions

File tree

tests/testthat/test_formats.R

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
context("Formats")
33

4-
test_format <- function(name, file_check = TRUE, os_skip = NULL) {
4+
test_format <- function(name, os_skip = NULL) {
55

66
test_that(paste(name, "format"), {
77

@@ -27,27 +27,18 @@ test_format <- function(name, file_check = TRUE, os_skip = NULL) {
2727
edit = FALSE)
2828

2929
# render it
30-
capture.output({
31-
if (file_check) {
32-
output_file <- tempfile(fileext = ".pdf")
33-
rmarkdown::render(testdoc, output_file = output_file)
34-
expect_true(file.exists(output_file))
35-
} else {
36-
rmarkdown::render(testdoc)
37-
}
38-
})
30+
output_file <- rmarkdown::render(testdoc)
31+
expect_true(file.exists(output_file))
3932
})
4033
}
4134

4235
test_format("acm_article")
36+
test_format("acs_article")
37+
test_format("aea_article")
38+
test_format("ams_article")
39+
test_format("asa_article")
4340
test_format("elsevier_article")
44-
test_format("jss_article", file_check = FALSE)
45-
test_format("rjournal_article", file_check = FALSE)
46-
test_format("acs_article", file_check = FALSE)
47-
test_format("pnas_article")
48-
test_format("aea_article", file_check = FALSE)
49-
test_format("ams_article", file_check = FALSE)
41+
test_format("jss_article")
5042
test_format("plos_article")
51-
52-
53-
43+
test_format("pnas_article")
44+
test_format("rjournal_article")

0 commit comments

Comments
 (0)