tests/testthat/test-with_brand_yml.R

test_that("with_brand_yml", {
  withr::local_envvar(BRAND_YML_PATH = "original")
  tmpdir <- withr::local_tempdir("brand")
  brand_path <- file.path(tmpdir, "my-brand.yml")

  with_brand_yml_path(brand_path, {
    expect_equal(Sys.getenv("BRAND_YML_PATH", "unset"), brand_path)
  })

  expect_equal(Sys.getenv("BRAND_YML_PATH", "unset"), "original")
})

Try the brand.yml package in your browser

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

brand.yml documentation built on Nov. 6, 2025, 5:06 p.m.