tests/testthat/test-oc_hostname.R

test_that("the hostname is read correctly", {
  Sys.setenv(OPENCAST_HOST = "https://legacy.opencast.org")
  expect_equal(oc_hostname(), "https://legacy.opencast.org")
})

test_that("an error is thrown when the hostname is not set", {
  Sys.unsetenv("OPENCAST_HOST")
  expect_error(oc_hostname())
})

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.