tests/testthat/test-other.R

# This tests the various other miscellaneous functions.
# library(testthat); library(rebook); source("test-other.R")

test_that("setupHTML works as expected", {
    expect_output(setupHTML(), "rebook-collapse")
})

test_that("chapterPreamble works as expected", {
    expect_output(chapterPreamble(), "rebook-collapse")
    expect_identical(knitr::opts_chunk$get("error"), FALSE)
    expect_identical(knitr::opts_chunk$get("message"), FALSE)
    expect_identical(knitr::opts_chunk$get("warning"), FALSE)
})

test_that("prettySessionInfo works as expected", {
    expect_output(prettySessionInfo(), "session info")
})

Try the rebook package in your browser

Any scripts or data that you put into this service are public.

rebook documentation built on Nov. 8, 2020, 4:56 p.m.