tests/testthat/test-write_json.R

test_that("write_json()", {
  expect_error(
    write_json(
      list(a = 1, b = 2),
      path = file.path(tempdir(), "test_folder", "test_json.json"),
      .backup = TRUE
    ),
    NA,
  )
  expect_error(
    write_json(
      list(a = 1, b = 2),
      path = file.path(tempdir(), "test_folder", "test_json.json"),
      .backup = TRUE
    ),
    NA,
  )
  expect_error(
    write_json(
      list(a = 1, b = 2),
      path = file.path(tempdir(), "test_folder", "test_json.json"),
      .backup = TRUE
    ),
    NA,
  )
})

Try the rstudio.prefs package in your browser

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

rstudio.prefs documentation built on July 16, 2022, 5:07 p.m.