@@ -83,7 +83,7 @@ test_that("roxygenize works in general", {
83
83
local_test_setup(git = FALSE , use_precommit = FALSE , package = TRUE )
84
84
writeLines(c(" #' This is a title" , " #'" , " #' More" , " #' @name test" , " NULL" ), " R/blur.R" )
85
85
# works
86
- mockery :: stub( roxygenize_with_cache , " diff_requires_run_roxygenize" , TRUE )
86
+ local_mocked_bindings( diff_requires_run_roxygenize = function ( ... ) TRUE )
87
87
expect_message(
88
88
roxygenize_with_cache(list (getwd()), dirs = dirs_R.cache(" roxygenize" )),
89
89
" test\\ .Rd"
@@ -96,7 +96,7 @@ test_that("fails when package is called but not installed in roclets", {
96
96
local_test_setup(git = FALSE , use_precommit = FALSE , package = TRUE )
97
97
writeLines(c(" NULL" ), " R/blur.R" )
98
98
# works
99
- mockery :: stub( roxygenize_with_cache , " diff_requires_run_roxygenize" , TRUE )
99
+ local_mocked_bindings( diff_requires_run_roxygenize = function ( ... ) TRUE )
100
100
# when there is a missing package
101
101
roxygen_field <- paste0(
102
102
' list(markdown = TRUE, roclets = c("rd", "namespace", "collate", "' ,
@@ -115,7 +115,7 @@ test_that("fails gratefully when not installed package is called (packageNotFoun
115
115
local_test_setup(git = FALSE , use_precommit = FALSE , package = TRUE )
116
116
writeLines(generate_uninstalled_pkg_call(), " R/blur.R" )
117
117
# works
118
- mockery :: stub( roxygenize_with_cache , " diff_requires_run_roxygenize" , TRUE )
118
+ local_mocked_bindings( diff_requires_run_roxygenize = function ( ... ) TRUE )
119
119
# when there is a missing package
120
120
expect_error(
121
121
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
129
129
desc :: desc_set_deps(
130
130
tibble :: tibble(type = " Imports" , package = generate_uninstalled_pkg_name(), version = " *" )
131
131
)
132
- mockery :: stub( roxygenize_with_cache , " diff_requires_run_roxygenize" , TRUE )
132
+ local_mocked_bindings( diff_requires_run_roxygenize = function ( ... ) TRUE )
133
133
expect_error(
134
134
suppressWarnings(
135
135
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
142
142
test_that(" fails when there is invalid code" , {
143
143
skip_on_cran()
144
144
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 )
146
146
# when there is a missing package
147
147
writeLines(c(" invalid code stuff /3kj" ), " R/more.R" )
148
148
expect_error(
@@ -154,7 +154,7 @@ test_that("fails when there is invalid code", {
154
154
test_that(" warns if there is any other warning" , {
155
155
skip_on_cran()
156
156
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 )
158
158
writeLines(
159
159
c(
160
160
" #' This is a title" , " #'" , " #' More" , " #" , " NULL"
0 commit comments