diff --git a/NAMESPACE b/NAMESPACE index cf13302..8eb63aa 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -3,6 +3,7 @@ export(generate_pkg) export(pkg_agent) export(use_beekeeper) +if (getRversion() < "4.3.0") importFrom("S7", "@") importFrom(glue,glue) importFrom(nectar,call_api) importFrom(rapid,as_rapid) diff --git a/R/zzz.R b/R/zzz.R index 8a7dd4d..0b7eb0c 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -1,3 +1,7 @@ .onLoad <- function(...) { S7::methods_register() # nocov } + +# enable usage of @name in package code +#' @rawNamespace if (getRversion() < "4.3.0") importFrom("S7", "@") +NULL diff --git a/tests/testthat/_snaps/use_beekeeper.md b/tests/testthat/_snaps/use_beekeeper.md deleted file mode 100644 index 9b541b3..0000000 --- a/tests/testthat/_snaps/use_beekeeper.md +++ /dev/null @@ -1,11 +0,0 @@ -# config writes a yml - - Code - test_result_file - Output - [1] "api_title: APIs.guru" - [2] "api_abbr: guru" - [3] "api_version: 2.2.0" - [4] "rapid_file: RAPID_FILE_PATH" - [5] "updated_on: DATETIME" - diff --git a/tests/testthat/test-use_beekeeper.R b/tests/testthat/test-use_beekeeper.R index 2ac141c..3fda458 100644 --- a/tests/testthat/test-use_beekeeper.R +++ b/tests/testthat/test-use_beekeeper.R @@ -22,9 +22,13 @@ test_that("config writes a yml", { expect_identical(test_result, config_path) reread_rapid <- readRDS(rapid_write_path) expect_identical(guru_rapid, reread_rapid) - test_result_file <- readLines(config_path) - expect_snapshot( + test_result_file <- scrub_config(readLines(config_path)) + expected_result_file <- scrub_config( + readLines(test_path("_fixtures", "guru_beekeeper.yml")) + ) + expected_result_file[[4]] <- "rapid_file: RAPID_FILE_PATH\"" + expect_identical( test_result_file, - transform = scrub_config + expected_result_file ) })