@@ -83,7 +83,7 @@ test_that("roxygenize works in general", {
8383 local_test_setup(git = FALSE , use_precommit = FALSE , package = TRUE )
8484 writeLines(c(" #' This is a title" , " #'" , " #' More" , " #' @name test" , " NULL" ), " R/blur.R" )
8585 # works
86- mockery :: stub( roxygenize_with_cache , " diff_requires_run_roxygenize" , TRUE )
86+ local_mocked_bindings( diff_requires_run_roxygenize = function ( ... ) TRUE )
8787 expect_message(
8888 roxygenize_with_cache(list (getwd()), dirs = dirs_R.cache(" roxygenize" )),
8989 " test\\ .Rd"
@@ -96,7 +96,7 @@ test_that("fails when package is called but not installed in roclets", {
9696 local_test_setup(git = FALSE , use_precommit = FALSE , package = TRUE )
9797 writeLines(c(" NULL" ), " R/blur.R" )
9898 # works
99- mockery :: stub( roxygenize_with_cache , " diff_requires_run_roxygenize" , TRUE )
99+ local_mocked_bindings( diff_requires_run_roxygenize = function ( ... ) TRUE )
100100 # when there is a missing package
101101 roxygen_field <- paste0(
102102 ' list(markdown = TRUE, roclets = c("rd", "namespace", "collate", "' ,
@@ -115,7 +115,7 @@ test_that("fails gratefully when not installed package is called (packageNotFoun
115115 local_test_setup(git = FALSE , use_precommit = FALSE , package = TRUE )
116116 writeLines(generate_uninstalled_pkg_call(), " R/blur.R" )
117117 # works
118- mockery :: stub( roxygenize_with_cache , " diff_requires_run_roxygenize" , TRUE )
118+ local_mocked_bindings( diff_requires_run_roxygenize = function ( ... ) TRUE )
119119 # when there is a missing package
120120 expect_error(
121121 roxygenize_with_cache(list (getwd()), dirs = dirs_R.cache(" roxygenize" )),
@@ -129,7 +129,7 @@ test_that("fails gratefully when not installed package is required according to
129129 desc :: desc_set_deps(
130130 tibble :: tibble(type = " Imports" , package = generate_uninstalled_pkg_name(), version = " *" )
131131 )
132- mockery :: stub( roxygenize_with_cache , " diff_requires_run_roxygenize" , TRUE )
132+ local_mocked_bindings( diff_requires_run_roxygenize = function ( ... ) TRUE )
133133 expect_error(
134134 suppressWarnings(
135135 roxygenize_with_cache(list (getwd()), dirs = dirs_R.cache(" roxygenize" ))
@@ -142,7 +142,7 @@ test_that("fails gratefully when not installed package is required according to
142142test_that(" fails when there is invalid code" , {
143143 skip_on_cran()
144144 local_test_setup(git = FALSE , use_precommit = FALSE , package = TRUE )
145- mockery :: stub( roxygenize_with_cache , " diff_requires_run_roxygenize" , TRUE )
145+ local_mocked_bindings( diff_requires_run_roxygenize = function ( ... ) TRUE )
146146 # when there is a missing package
147147 writeLines(c(" invalid code stuff /3kj" ), " R/more.R" )
148148 expect_error(
@@ -154,7 +154,7 @@ test_that("fails when there is invalid code", {
154154test_that(" warns if there is any other warning" , {
155155 skip_on_cran()
156156 local_test_setup(git = FALSE , use_precommit = FALSE , package = TRUE )
157- mockery :: stub( roxygenize_with_cache , " diff_requires_run_roxygenize" , TRUE )
157+ local_mocked_bindings( diff_requires_run_roxygenize = function ( ... ) TRUE )
158158 writeLines(
159159 c(
160160 " #' This is a title" , " #'" , " #' More" , " #" , " NULL"
0 commit comments