tests/testthat/test-variable-excel-dao.R

context("Variable Excel Sheet")

library(variableMetadataPreparation) #nolint

variable_excel_dao <- NULL

setup({
  variable_excel_dao <<- VariableExcelDao$new(
    system.file("extdata/excel/vimport_ds3.xlsx",
    package = "variableMetadataPreparation"))
})

teardown({
  variable_excel_dao <<- NULL
})

test_that("scale level of pid is correct", {
  variable <- variable_excel_dao$get_variable("pid")
  expect_identical(variable$get_scale_level()$get_de(),
    jsonlite::unbox("nominal"))
})
dzhw/variableMetadataPreparation documentation built on Nov. 8, 2021, 8:24 p.m.