tests/testthat/test-write_fr_tdr.R

test_that("write_fr_tdr works", {
  skip_on_os(os = "windows")
  write_fr_tdr(as_fr_tdr(mtcars, name = "my_mtcars"), dir = tempdir())
  expect_snapshot_file(fs::path(tempdir(), "my_mtcars", "my_mtcars.csv"))
  expect_snapshot_file(fs::path(tempdir(), "my_mtcars", "tabular-data-resource.yaml"))
  read_fr_tdr(fs::path(tempdir(), "my_mtcars")) |>
    expect_s3_class("fr_tdr")
})

Try the fr package in your browser

Any scripts or data that you put into this service are public.

fr documentation built on May 29, 2024, 8:35 a.m.