Skip to content

Commit

Permalink
skip impl-hook tests since we have hook tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzwalthert committed Mar 30, 2024
1 parent d2339ad commit d8f2dba
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/testthat/test-impl-hook-roxygenize.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("relevant diffs can be detected", {
skip_on_cran()
withr::with_tempdir({
fs::dir_create("R")
# when new lines are added
Expand Down Expand Up @@ -42,6 +43,7 @@ test_that("relevant diffs can be detected", {
})

test_that("change in formals alone triggers invalidation", {
skip_on_cran()
# when the function formals change but nothing else
withr::with_tempdir({
fs::dir_create("R")
Expand Down Expand Up @@ -77,6 +79,7 @@ test_that("asserting installed dependencies", {
})

test_that("roxygenize works in general", {
skip_on_cran()
local_test_setup(git = FALSE, use_precommit = FALSE, package = TRUE)
writeLines(c("#' This is a title", "#'", "#' More", "#' @name test", "NULL"), "R/blur.R")
# works
Expand All @@ -89,6 +92,7 @@ test_that("roxygenize works in general", {


test_that("fails when package is called but not installed in roclets", {
skip_on_cran()
local_test_setup(git = FALSE, use_precommit = FALSE, package = TRUE)
writeLines(c("NULL"), "R/blur.R")
# works
Expand All @@ -107,6 +111,7 @@ test_that("fails when package is called but not installed in roclets", {


test_that("fails gratefully when not installed package is called (packageNotFoundError)", {
skip_on_cran()
local_test_setup(git = FALSE, use_precommit = FALSE, package = TRUE)
writeLines(generate_uninstalled_pkg_call(), "R/blur.R")
# works
Expand All @@ -119,6 +124,7 @@ test_that("fails gratefully when not installed package is called (packageNotFoun
})

test_that("fails gratefully when not installed package is required according to `DESCRIPTION`", {
skip_on_cran()
local_test_setup(git = FALSE, use_precommit = FALSE, package = TRUE)
desc::desc_set_deps(
tibble::tibble(type = "Imports", package = generate_uninstalled_pkg_name(), version = "*")
Expand All @@ -134,6 +140,7 @@ test_that("fails gratefully when not installed package is required according to


test_that("fails when there is invalid code", {
skip_on_cran()
local_test_setup(git = FALSE, use_precommit = FALSE, package = TRUE)
mockery::stub(roxygenize_with_cache, "diff_requires_run_roxygenize", TRUE)
# when there is a missing package
Expand All @@ -145,6 +152,7 @@ test_that("fails when there is invalid code", {
})

test_that("warns if there is any other warning", {
skip_on_cran()
local_test_setup(git = FALSE, use_precommit = FALSE, package = TRUE)
mockery::stub(roxygenize_with_cache, "diff_requires_run_roxygenize", TRUE)
writeLines(
Expand Down

0 comments on commit d8f2dba

Please sign in to comment.