From 5394e30a51cd8164dc7de5d0db97ee900b4bf58f Mon Sep 17 00:00:00 2001 From: Pawel Rucki <12943682+pawelru@users.noreply.github.com> Date: Mon, 23 Sep 2024 12:05:55 +0200 Subject: [PATCH] support older roxygen2 --- R/tag_examplesShinylive.R | 2 +- tests/testthat/test-tag_examplesShinylive.R | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/R/tag_examplesShinylive.R b/R/tag_examplesShinylive.R index 1ffe962..75ee6cd 100644 --- a/R/tag_examplesShinylive.R +++ b/R/tag_examplesShinylive.R @@ -132,7 +132,7 @@ roxy_tag_parse.roxy_tag_examplesShinylive <- function(x) { } # not elegant but this is the most efficient way to access sibling tags - tokens <- get("tokens", envir = parent.frame(3L)) + tokens <- dynGet("tokens") tags_examples <- Filter(function(x) x$tag %in% c("examples", "examplesIf"), tokens) diff --git a/tests/testthat/test-tag_examplesShinylive.R b/tests/testthat/test-tag_examplesShinylive.R index ace91b5..32a17cf 100644 --- a/tests/testthat/test-tag_examplesShinylive.R +++ b/tests/testthat/test-tag_examplesShinylive.R @@ -1,4 +1,5 @@ test_that("examplesShinylive tag - errors - missing @examples", { + skip_if_not(packageVersion("roxygen2") >= "7.3.0") text <- " #' This is a title #' @@ -240,6 +241,7 @@ test_that("examplesShinylive tag - keywords - {{tags_examples}}", { }) test_that("examplesShinylive tag - keywords - error when parsing with glue", { + skip_if_not(packageVersion("roxygen2") >= "7.3.0") text <- " #' This is a title #'