From 672e2984a88b001433226ae2ded3f6a7b216119a Mon Sep 17 00:00:00 2001 From: hsonne Date: Tue, 28 Nov 2023 21:58:08 +0100 Subject: [PATCH] Add two more tests --- tests/testthat/test-function-getExampleData.R | 11 +++++++++++ tests/testthat/test-function-getExampleFile.R | 7 +++++++ 2 files changed, 18 insertions(+) create mode 100644 tests/testthat/test-function-getExampleData.R create mode 100644 tests/testthat/test-function-getExampleFile.R diff --git a/tests/testthat/test-function-getExampleData.R b/tests/testthat/test-function-getExampleData.R new file mode 100644 index 0000000..590bbdb --- /dev/null +++ b/tests/testthat/test-function-getExampleData.R @@ -0,0 +1,11 @@ +test_that("getExampleData() works", { + + f <- kwb.en13508.2:::getExampleData + + result <- f() + + expect_identical( + names(result), + c("header.info", "inspections", "observations") + ) +}) diff --git a/tests/testthat/test-function-getExampleFile.R b/tests/testthat/test-function-getExampleFile.R new file mode 100644 index 0000000..2a4570e --- /dev/null +++ b/tests/testthat/test-function-getExampleFile.R @@ -0,0 +1,7 @@ +test_that("getExampleFile() works", { + + f <- kwb.en13508.2:::getExampleFile + + expect_true(file.exists(f())) + +})