tests/testthat/test-db-name.R

test_that("db_name", {
  sbf_reset()
  sbf_set_main(file.path(withr::local_tempdir(), "output"))
  withr::defer(sbf_reset())

  expect_identical(sbf_reset_db_name(), "database")
  expect_identical(sbf_get_db_name(), "database")
  expect_identical(sbf_set_db_name("db2"), "db2")
  expect_identical(sbf_get_db_name(), "db2")
  expect_identical(sbf_reset_db_name(), "database")
  expect_identical(sbf_get_db_name(), "database")
})
poissonconsulting/subfoldr2 documentation built on Nov. 17, 2024, 1:33 a.m.