tests/testthat/test-config.R

test_that("local, custom config roundtrip", {
  repo <- git_init(tempfile("gert-tests-config"))
  on.exit(unlink(repo, recursive = TRUE))

  orig <- git_config_set("aaa.bbb", "ccc", repo)
  expect_null(orig)
  cfg <- git_config(repo)
  expect_equal(cfg$value[cfg$name == "aaa.bbb"], "ccc")

  orig <- git_config_set("aaa.bbb", NULL, repo)
  expect_equal(orig, "ccc")
  cfg <- git_config(repo)
  expect_equal(cfg$value[cfg$name == "aaa.bbb"], character())
})

Try the gert package in your browser

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

gert documentation built on Sept. 26, 2023, 5:08 p.m.