tests/testthat/test-oc_password.R

test_that("the password is read correctly", {
  Sys.setenv(OPENCAST_PASSWORD = "opencast")
  expect_equal(oc_password(), "opencast")
})

test_that("an error is thrown when the password is not set", {
  Sys.unsetenv("OPENCAST_PASSWORD")
  expect_error(oc_password())
})

Try the opencastR package in your browser

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

opencastR documentation built on March 19, 2020, 5:12 p.m.