@@ -6,8 +6,13 @@ test_that("stat_bin throws error when y aesthetic present", {
6
6
expect_error(ggplot_build(ggplot(dat , aes(x , y )) + stat_bin()),
7
7
" must not be used with a y aesthetic." )
8
8
9
- expect_error(p <- ggplot_build(ggplot(dat , aes(x )) + stat_bin(y = 5 )),
10
- " Unknown parameters: y" )
9
+ expect_warning(
10
+ expect_error(
11
+ ggplot_build(ggplot(dat , aes(x )) + stat_bin(y = 5 )),
12
+ " StatBin requires a continuous x"
13
+ ),
14
+ " unknown parameters: y"
15
+ )
11
16
})
12
17
13
18
test_that(" bins specifies the number of bins" , {
@@ -116,8 +121,8 @@ test_that("stat_count throws error when y aesthetic present", {
116
121
expect_error(ggplot_build(ggplot(dat , aes(x , y )) + stat_count()),
117
122
" must not be used with a y aesthetic." )
118
123
119
- expect_error (p <- ggplot_build(ggplot(dat , aes(x )) + stat_count(y = 5 )),
120
- " Unknown parameters: y" )
124
+ expect_warning (p <- ggplot_build(ggplot(dat , aes(x )) + stat_count(y = 5 )),
125
+ " unknown parameters: y" )
121
126
})
122
127
123
128
test_that(" stat_count preserves x order for continuous and discrete" , {
0 commit comments