Skip to content

Commit ec18895

Browse files
fix test problems
1 parent 992fb8e commit ec18895

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

R/setup.R

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,7 @@ snippet_generate <- function(snippet = "", root = here::here()) {
113113
)
114114
deps <- desc::desc_get_deps()
115115
deps <- deps[order(deps$package), ]
116-
paste0(
117-
" - ", deps$package, "@",
118-
purrr::map_chr(deps$package, ~ as.character(packageVersion(.x))), "\n",
119-
collapse = ""
120-
) %>%
121-
sort() %>%
116+
snippet_generate_impl_additional_deps_roxygenize(deps$package) %>%
122117
cat(sep = "")
123118
remote_deps <- rlang::with_handlers(
124119
desc::desc_get_field("Remotes"),
@@ -144,3 +139,12 @@ You need in your `.pre-commit-config.yaml`
144139
}
145140
}
146141
}
142+
143+
snippet_generate_impl_additional_deps_roxygenize <- function(packages) {
144+
paste0(
145+
" - ", packages, "@",
146+
purrr::map_chr(packages, ~ as.character(packageVersion(.x))), "\n",
147+
collapse = ""
148+
) %>%
149+
sort()
150+
}

tests/testthat/test-cache.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ test_that("CLI API works for roxygenize", {
5353
suffix = "-cache-success.R",
5454
env = paste0("R_CACHE_ROOTPATH=", R.cache_root),
5555
msg = "You can silent this",
56-
artifacts = c("DESCRIPTION" = test_path("in/DESCRIPTION")),
56+
artifacts = c("DESCRIPTION" = test_path("in/DESCRIPTION-no-deps.dcf")),
5757
file_transformer = function(x) {
5858
git2r::init()
5959
x

tests/testthat/test-conda.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if (!on_cran()) {
88
test_that("can use pre-commit", {
99
tempdir <- local_test_setup(quiet = FALSE, install_hooks = FALSE)
1010
expect_message(
11-
use_precommit(open = FALSE, force = TRUE, root = tempdir),
11+
use_precommit(open = FALSE, force = TRUE, install_hooks = FALSE, root = tempdir),
1212
"to get the latest"
1313
)
1414
expect_message(

tests/testthat/test-config.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ test_that(".Rbuildignore is written to the right directory when root is relative
5252
})
5353
withr::with_dir(
5454
fs::path_dir(root),
55-
use_precommit_config(install_hooks = FALSE, root = fs::path_file(root))
55+
use_precommit_config(root = fs::path_file(root))
5656
)
5757
expect_true(fs::file_exists(fs::path(root, ".Rbuildignore")))
5858
})

0 commit comments

Comments
 (0)