tests/testthat/test-postcards.R

test_template <- function(template){
  skip_on_cran()

  temp_file <- tempfile()

  test_file_path <- postcards::create_postcard(temp_file, template, edit = FALSE, create_image = FALSE)
  file.exists(test_file_path)
}

test_that("Templates can be created.", {
  expect_true(test_template("jolla"))
  expect_true(test_template("jolla-blue"))
  expect_true(test_template("trestles"))
  expect_true(test_template("onofre"))
  expect_true(test_template("solana"))
})

Try the postcards package in your browser

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

postcards documentation built on Jan. 7, 2022, 9:06 a.m.