tests/testthat/test-group_write.R

library(withr)

test_that("group_write outputs correct file name", {
  with_tempdir({
    group_write(iris, Species, dir = ".")
    expect_identical(
      list.files(".", pattern = "iris-.+\\.csv$"),
      c("iris-setosa.csv", "iris-versicolor.csv", "iris-virginica.csv")
    )
  })
})
enixam/ymisc documentation built on Nov. 22, 2022, 1:31 a.m.