Skip to content

Commit 98202cb

Browse files
committed
separate old guide expectations
1 parent bf1d378 commit 98202cb

File tree

3 files changed

+63
-66
lines changed

3 files changed

+63
-66
lines changed

tests/testthat/_snaps/guide-old.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/testthat/_snaps/guide-old/old-s3-guide-drawing-a-circle.svg

Lines changed: 53 additions & 53 deletions
Loading

tests/testthat/test-guide-old.R

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,15 @@ test_that("old S3 guides can be implemented", {
5151
my_guides <- guides(x = guide_circle())
5252
expect_length(my_guides$guides, 1)
5353
expect_s3_class(my_guides$guides[[1]], "guide")
54+
title <- "old S3 guide drawing a circle"
5455

55-
expect_snapshot_warning(
56-
expect_doppelganger(
57-
"old S3 guide drawing a circle",
58-
ggplot(mtcars, aes(disp, mpg)) +
59-
geom_point() +
60-
my_guides
61-
)
62-
)
56+
p <- ggplot(mtcars, aes(disp, mpg)) +
57+
geom_point() +
58+
my_guides +
59+
theme_test() +
60+
labs(title = title)
61+
62+
lifecycle::expect_deprecated(gt <- ggplotGrob(p))
63+
64+
expect_doppelganger(title, fig = function() grid.draw(gt))
6365
})

0 commit comments

Comments
 (0)