tests/testthat/test-example.R

context("example")

test_that("add tests", {
  filename <- "example.Rmd"
  unlink(filename)
  expect_false(filename %in% dir())
  build_example(open = FALSE)
  expect_true(filename %in% dir())
  expect_true(any(grepl("Example Document", readLines(filename))))
  unlink(filename)
})

Try the tutorial package in your browser

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

tutorial documentation built on May 2, 2019, 9:34 a.m.