tests/testthat/test-1_create_config.R

test_that("create configuration folder if needed", {
  if(file.exists(paste(tempdir(), "config.yml", sep = "/"))){
    expect_warning(create_config(create_directory=FALSE))
  } else {
    expect_no_warning(create_config(create_directory=FALSE))
  }
  expect_true(file.exists(paste(tempdir(), "config.yml", sep = "/")))
})

test_that("check yml arguments", {
  expect_warning(create_config(create_directory=FALSE))
  configuration <- config::get(file = paste(tempdir(), "config.yml", sep = "/"))
  expect_identical(sort(names(configuration)), c('segments','url'))
})

Try the telraamStats package in your browser

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

telraamStats documentation built on May 29, 2024, 10:08 a.m.