tests/testthat/test-function-set_columns.R

test_that("set_columns() works", {

  f <- function(...) suppressMessages(kwb.prep:::set_columns(...))
  capt <- capture.output
  
  expect_error(capt(f()))

  capt(result <- f(data.frame(a = 1:2), b = "hello"))

  expect_identical(result$b, c("hello", "hello"))
})
KWB-R/kwb.prep documentation built on June 11, 2022, 1:29 p.m.