tests/testthat/test-bulk_replace.R

test_that("bulk_replace works", {
  temp_file <- tempfile("test", fileext = ".Rmd")
  export_template("#", temp_file)
  expect_message(bulk_replace(c(temp_file), "#", "##"))
  bulk_replace(c(temp_file), "#", "##", dry.run = FALSE)
  expect_equal(
    nchar(import_pattern(temp_file)),
    2
  )
})

Try the heddlr package in your browser

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

heddlr documentation built on March 24, 2020, 9:07 a.m.