tests/testthat/test-gutenberg_strip.R

test_that("gutenberg_strip strips header and footer", {
  to_strip <- readLines(test_path("fixtures", "109-to-strip.txt"))
  test_result <- gutenberg_strip(to_strip)
  expected_result <- c(
    "Renascence and Other Poems",
    "by Edna St. Vincent Millay"
  )
  expect_identical(test_result, expected_result)
})

Try the gutenbergr package in your browser

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

gutenbergr documentation built on June 8, 2025, 11:26 a.m.