vignettes/tests/test_util_cat_sys.Rmd
test_util_cat_sys.Rmd
library(testthat)
library(jeksterslabRutils)
context("Test util_cat_sys.")
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 |
results <- capture.output(
util_cat_sys(
command = "date +%Y"
)
)
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 🎉