tests/testthat/test-ConfEnv.R

library(rconf)
library(testthat)
context("ConfEnv")

exampleyml <- system.file("extdata", "example.yml", package="rconf")
Conf <- ConfEnv$new(exampleyml)

test_that("test ConfEnv with example.yml", {
  expect_equal(Conf$getornull("nosuchfield"), NULL)
  expect_equal(Conf$getorstop("config"), "config")
  expect_equal(Conf$getorstop("db"), list(host="somehost", port="someport"))
  expect_equal(Conf$getornull("db.host"), "somehost")
})
obarisk/rconf documentation built on May 3, 2019, 9:01 p.m.