From ffcf3327469087a6923ff4349fc31e08b3487f31 Mon Sep 17 00:00:00 2001 From: Jan Marvin Garbuszus Date: Wed, 12 Jul 2023 21:21:13 +0200 Subject: [PATCH] provide an artificial datetime for the flaking wrapper test --- R/expect-wrapper.R | 3 +++ tests/testthat/test-class-workbook-wrappers.R | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/R/expect-wrapper.R b/R/expect-wrapper.R index 58080c525..2ac4cace4 100644 --- a/R/expect-wrapper.R +++ b/R/expect-wrapper.R @@ -107,6 +107,9 @@ expect_wrapper <- function( return(invisible()) } + # set artificial datetimeCreate date to avoid crashes due to the second + wb$datetimeCreated <- "2000-01-01 00:00:00 CEST" + if (!is.null(params)) { # create now so that it's the same every time wb_fun <- wb$clone(deep = TRUE) diff --git a/tests/testthat/test-class-workbook-wrappers.R b/tests/testthat/test-class-workbook-wrappers.R index d067c5794..fa2d42ea9 100644 --- a/tests/testthat/test-class-workbook-wrappers.R +++ b/tests/testthat/test-class-workbook-wrappers.R @@ -133,7 +133,7 @@ test_that("wb_set_creators() is a wrapper", { test_that("wb_remove_creators() is a wrapper", { wb <- wb_workbook(creator = "myself") - expect_wrapper("remove_creators", params = list(creators = "myself")) + expect_wrapper("remove_creators", wb = wb, params = list(creators = "myself")) }) # wb_page_setup() -------------------------------------------------------------