Skip to content

Commit 1c80441

Browse files
committed
use snapshot test
1 parent a6fd43f commit 1c80441

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

tests/testthat/_snaps/geom-raster.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@
1414

1515
`vjust` must be a number, not the string "a".
1616

17+
---
18+
19+
Code
20+
b <- ggplotGrob(p)
21+
Message
22+
`geom_raster()` only works with linear coordinate systems, not `coord_polar()`.
23+
i Falling back to drawing as `geom_rect()`.
24+
1725
# geom_raster() fails with pattern fills
1826

1927
Problem while converting geom to grob.

tests/testthat/test-geom-raster.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test_that("geom_raster() checks input and coordinate system", {
66

77
df <- data_frame(x = rep(c(-1, 1), each = 3), y = rep(-1:1, 2), z = 1:6)
88
p <- ggplot(df, aes(x, y, fill = z)) + geom_raster() + coord_polar()
9-
expect_message(ggplotGrob(p), "only works with")
9+
expect_snapshot(b <- ggplotGrob(p))
1010
})
1111

1212
test_that("geom_raster() fails with pattern fills", {

0 commit comments

Comments
 (0)