tests/testthat/test-read_rds.R

examples_dir <- system.file( "examples", package = "retroharmonize")

test_read <- read_rds ( file.path(examples_dir, "ZA7576.rds"),
                        id = "ZA7576", 
                        doi = "test_doi")

attributes( test_read )

test_that("attributes work", {
  expect_equal(attr(test_read, "id"), "ZA7576")
  expect_equal(attr(test_read, "filename"), "ZA7576.rds")
  expect_equal(attr(test_read, "doi"), "test_doi")
})

Try the retroharmonize package in your browser

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

retroharmonize documentation built on Nov. 3, 2021, 1:07 a.m.