@@ -3,7 +3,7 @@ context("geom_rect")
3
3
expect_traces <- function (gg , n.traces , name ){
4
4
stopifnot(is.ggplot(gg ))
5
5
stopifnot(is.numeric(n.traces ))
6
- save_outputs(gg , paste0(" rects -" , name ))
6
+ save_outputs(gg , paste0(" rect -" , name ))
7
7
L <- gg2list(gg )
8
8
is.trace <- names(L ) == " "
9
9
all.traces <- L [is.trace ]
@@ -68,7 +68,7 @@ rect.color <- ggplot(df4, aes(xmin = x, xmax = x + 0.5, ymin = 0, ymax = 1)) +
68
68
geom_rect(aes(color = status ), fill = " grey" )
69
69
70
70
test_that(' rect color' , {
71
- info <- expect_traces(rect.color , 2 , " rect- color" )
71
+ info <- expect_traces(rect.color , 2 , " color" )
72
72
traces.by.name <- list ()
73
73
for (tr in info $ traces ){
74
74
expect_equal(tr $ fillcolor , toRGB(" grey" ))
@@ -95,7 +95,7 @@ rect.fill <- ggplot(df4, aes(xmin = x, xmax = x + 0.5, ymin = 0, ymax = 1)) +
95
95
geom_rect(aes(fill = status ))
96
96
97
97
test_that(' rect color' , {
98
- info <- expect_traces(rect.fill , 2 , " rect- fill" )
98
+ info <- expect_traces(rect.fill , 2 , " fill" )
99
99
traces.by.name <- list ()
100
100
for (tr in info $ traces ){
101
101
expect_equal(tr $ line $ color , " transparent" )
@@ -123,7 +123,7 @@ rect.fill.color <-
123
123
geom_rect(aes(fill = status ), color = " black" )
124
124
125
125
test_that(' rect aes(fill) with constant color' , {
126
- info <- expect_traces(rect.fill.color , 2 , " rect- fill-color" )
126
+ info <- expect_traces(rect.fill.color , 2 , " fill-color" )
127
127
traces.by.name <- list ()
128
128
for (tr in info $ traces ){
129
129
expect_equal(tr $ line $ color , toRGB(" black" ))
0 commit comments