tests/testthat/test-pub_sections.R

context("pub_sections")

test_that("pub_sections works", {
  expect_is(pub_sections(), "character")
  expect_true(any(grepl("title", pub_sections())))
  expect_true(any(grepl("publisher", pub_sections())))
  expect_true(any(grepl("history", pub_sections())))
})

test_that("pub_sections fails well", {
  expect_error(pub_sections(5), "unused argument")
})

Try the pubchunks package in your browser

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

pubchunks documentation built on Sept. 4, 2020, 5:06 p.m.