tests/testthat/test-read_spss.R

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

read_example <- read_spss(
  file = file.path(examples_dir, "iris1.sav"),
  id = "my_iris")

test_that("attributes work", {
  expect_equal(attr(read_example, "id"), "my_iris")
  expect_equal(attr(read_example, "filename"), "iris1.sav")
  expect_equal(attr(read_example, "doi"), NULL)
})


test_that("exception handling works", {
  expect_error ( read_spss (file.path(examples_dir, "not_iris.sav")))
})

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.