Skip to content

Commit

Permalink
Merge pull request #27 from SchlossLab/knitr-opts
Browse files Browse the repository at this point in the history
Simplify the unit test for set_knitr_opts()
  • Loading branch information
sklucas authored Oct 25, 2021
2 parents 176297f + a9c6a75 commit 8e7d8cd
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 35 deletions.
2 changes: 1 addition & 1 deletion docs/articles/introduction.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ pkgdown: 1.6.1
pkgdown_sha: ~
articles:
introduction: introduction.html
last_built: 2021-05-19T19:53Z
last_built: 2021-10-25T17:27Z

16 changes: 8 additions & 8 deletions docs/reference/read_dist.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions docs/reference/read_tax.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 6 additions & 16 deletions tests/testthat/test-rmd_helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,13 @@ test_that("inline_hook() uses paste_oxford_list() and format_number() correctly"

test_that("set_knitr_opts() works", {
chunk <- list(
eval = TRUE, echo = FALSE, results = "markup", tidy = TRUE,
tidy.opts = NULL, collapse = FALSE, prompt = FALSE, comment = "##",
highlight = TRUE, strip.white = TRUE, size = "normalsize",
background = "#F7F7F7", cache = FALSE, cache.path = "cache/",
cache.vars = NULL, cache.lazy = TRUE, dependson = NULL, autodep = FALSE,
cache.rebuild = FALSE, fig.keep = "high", fig.show = "asis",
fig.align = "default", fig.path = "figure/", dev = NULL,
dev.args = NULL, dpi = 72, fig.ext = NULL, fig.width = 7,
fig.height = 7, fig.env = "figure", fig.cap = NULL, fig.scap = NULL,
fig.lp = "fig:", fig.subcap = NULL, fig.pos = "", out.width = NULL,
out.height = NULL, out.extra = NULL, fig.retina = 1, external = TRUE,
sanitize = FALSE, interval = 1, aniopts = "controls,loop",
warning = FALSE, error = TRUE, message = TRUE, render = NULL,
ref.label = NULL, child = NULL, engine = "R", split = FALSE,
include = TRUE, purl = TRUE
tidy = TRUE,
echo = FALSE,
eval = TRUE,
warning = FALSE,
cache = FALSE
)
set_knitr_opts()
expect_equal(knitr::opts_chunk$get(), chunk)
expect_equal(knitr::opts_chunk$get()[names(chunk)], chunk)
expect_equal(knitr::knit_hooks$get("inline"), inline_hook)
})

0 comments on commit 8e7d8cd

Please sign in to comment.