Parameters

year <- format(Sys.time(), "%Y")
knitr::kable(
  x = data.frame(
    Variable = "`year`",
    Description = "Current year.",
    Value = year
  ),
  row.names = FALSE
)
Variable Description Value
year Current year. 2021

Run test

results <- capture.output(
  util_cat_sys(
    command = "date +%Y"
  )
)

Results

knitr::kable(
  x = data.frame(
    Description = "Current year.",
    Parameter = year,
    Result = results
  ),
  row.names = FALSE
)
Description Parameter Result
Current year. 2021 2021
test_that("util_cat_sys works", {
  expect_equivalent(
    results,
    year
  )
})
#> Test passed 🎉