Skip to content

Commit 1cf5af1

Browse files
committed
try without messing with environment
1 parent 109fca1 commit 1cf5af1

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

tests/testthat/test-guide-old.R

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
skip_on_cran() # This test suite is long-running (on cran) and is skipped
22

33
test_that("old S3 guides can be implemented", {
4-
my_env <- env()
5-
my_env$guide_circle <- function() {
4+
5+
guide_circle <- function() {
66
structure(
77
list(available_aes = c("x", "y"), position = "bottom"),
88
class = c("guide", "circle")
@@ -12,26 +12,22 @@ test_that("old S3 guides can be implemented", {
1212
registerS3method(
1313
"guide_train",
1414
"circle",
15-
function(guide, ...) guide,
16-
envir = my_env
15+
function(guide, ...) guide
1716
)
1817
registerS3method(
1918
"guide_transform",
2019
"circle",
21-
function(guide, ...) guide,
22-
envir = my_env
20+
function(guide, ...) guide
2321
)
2422
registerS3method(
2523
"guide_merge",
2624
"circle",
27-
function(guide, ...) guide,
28-
envir = my_env
25+
function(guide, ...) guide
2926
)
3027
registerS3method(
3128
"guide_geom",
3229
"circle",
33-
function(guide, ...) guide,
34-
envir = my_env
30+
function(guide, ...) guide
3531
)
3632
registerS3method(
3733
"guide_gengrob",
@@ -42,11 +38,9 @@ test_that("old S3 guides can be implemented", {
4238
height = unit(1, "cm"),
4339
width = unit(1, "cm")
4440
)
45-
},
46-
envir = my_env
41+
}
4742
)
4843

49-
withr::local_environment(my_env)
5044
withr::local_options(lifecycle_verbosity = "quiet")
5145

5246
my_guides <- guides(x = guide_circle())

0 commit comments

Comments
 (0)