From 2d2d3b8e46583b079d2a68b7e00816c186cf237e Mon Sep 17 00:00:00 2001 From: Thierry Onkelinx Date: Tue, 28 May 2019 10:08:40 +0200 Subject: [PATCH] add missing unit test --- tests/testthat/test_e_upgrade.R | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/testthat/test_e_upgrade.R b/tests/testthat/test_e_upgrade.R index 1d9817f..887bb4c 100644 --- a/tests/testthat/test_e_upgrade.R +++ b/tests/testthat/test_e_upgrade.R @@ -52,6 +52,13 @@ test_that("upgrade_data() validates metadata", { correct_yaml <- yaml::read_yaml(file.path(root, junk[2])) junk_yaml <- correct_yaml + junk_yaml[["..generic"]][["git2rdata"]] <- "0.0.4" + yaml::write_yaml(junk_yaml, file.path(root, junk[2])) + expect_identical( + unname(upgrade_data(file = file, root = root)), + file + ) + junk_yaml <- correct_yaml junk_yaml[["..generic"]][["git2rdata"]] <- NULL junk_yaml[["test_Date"]] <- NULL yaml::write_yaml(junk_yaml, file.path(root, junk[2]))