| 1 |
test_that("Using skim_tee prints returns the object", { |
| 2 |
skip_if_not(l10n_info()$`UTF-8`) |
| 3 |
expect_snapshot({ |
| 4 |
skim_object <- skim_tee(chickwts) |
| 5 |
}) |
| 6 |
expect_identical(chickwts, skim_object) |
| 7 |
}) |
| 8 |
|
| 9 |
test_that("skim_tee prints only selected columns, but returns full object", { |
| 10 |
skip_if_not(l10n_info()$`UTF-8`) |
| 11 |
expect_snapshot({ |
| 12 |
obj <- skim_tee(iris, Species) |
| 13 |
}) |
| 14 |
expect_identical(obj, iris) |
| 15 |
}) |
| 16 |
|
| 17 |
test_that("skim_tee supports dplyr helpers", { |
| 18 |
skip_if_not(l10n_info()$`UTF-8`) |
| 19 |
expect_snapshot({ |
| 20 |
obj <- skim_tee(iris, starts_with("Sepal")) |
| 21 |
}) |
| 22 |
expect_identical(obj, iris) |
| 23 |
}) |
| 24 |
|
| 25 |
test_that("Skim_tee works with groups", { |
| 26 |
skip_if_not(l10n_info()$`UTF-8`) |
| 27 |
iris_grouped <- dplyr::group_by(iris, Species) |
| 28 |
my_skim <- skim_with(numeric = sfl(hist = NULL)) |
| 29 |
expect_snapshot({ |
| 30 |
obj <- skim_tee(iris_grouped, Sepal.Length, skim_fun = my_skim) |
| 31 |
}) |
| 32 |
expect_identical(obj, iris_grouped) |
| 33 |
}) |