Skip to content

Commit 45a769d

Browse files
committed
add test
1 parent cfd12e5 commit 45a769d

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

tests/testthat/_snaps/utilities.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,19 @@
5454

5555
Can't recycle `..1` (size 4) to match `..2` (size 0).
5656

57+
# summary method gives a nice summary
58+
59+
Code
60+
summary(p)
61+
Output
62+
data: manufacturer, model, displ, year, cyl, trans, drv, cty, hwy, fl,
63+
class [234x11]
64+
mapping: x = ~displ, y = ~hwy, colour = ~drv
65+
scales: x, xmin, xmax, xend, xintercept, xmin_final, xmax_final, xlower, xmiddle, xupper, x0, colour
66+
faceting: ~year, ~cyl
67+
-----------------------------------
68+
geom_point: na.rm = FALSE
69+
stat_identity: na.rm = FALSE
70+
position_identity
71+
72+

tests/testthat/test-utilities.R

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,3 +196,16 @@ test_that("expose/ignore_data() can round-trip a data.frame", {
196196
expect_equal(test, df[, c("a", "c", "b", "d")])
197197

198198
})
199+
200+
test_that("summary method gives a nice summary", {
201+
# This test isn't important enough to break anything on CRAN
202+
skip_on_cran()
203+
204+
p <- ggplot(mpg, aes(displ, hwy, colour = drv)) +
205+
geom_point() +
206+
scale_x_continuous() +
207+
scale_colour_brewer() +
208+
facet_grid(year ~ cyl)
209+
210+
expect_snapshot(summary(p))
211+
})

0 commit comments

Comments
 (0)