tests/testthat/test-badge.R

data <- data.frame(Names = c("Pippin", "Frodo"),
                   Affil = c("Home", NA))
path <- tempdir()

test_that("PDF file is created in the provided path", {

  skip_on_cran()
  skip_on_ci()

  create_badge(data, path = path, name.column = "Names", affiliation.column = "Affil")
  expect_true(file.exists(file.path(path, "Badges.pdf")))

})

Try the labeleR package in your browser

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

labeleR documentation built on April 3, 2025, 10:28 p.m.