@@ -57,7 +57,7 @@ test_that("ggR works with single valued rasters", {
5757})
5858
5959
60- test_that(" ggRGB returns proper ggplot2 classes or data.frames" , {
60+ test_that(" ggRGB returns proper ggplot2 classes or data.frames or lists of protos " , {
6161
6262 tests <- expand.grid(anno = c(TRUE , FALSE ), ggLayer = c(TRUE , FALSE ), ggObj = c(TRUE ,FALSE ), stretch = c(" sqrt" , " hist" , " log" , " lin" ))
6363 builds <- lapply(seq_len(nrow(tests )), function (i ) ggRGB(rlogo , ggObj = tests $ ggObj [i ], geom_raster = ! tests $ anno [i ], ggLayer = tests $ ggLayer [i ], stretch = tests $ stretch [i ] ))
@@ -70,12 +70,12 @@ test_that("ggRGB returns proper ggplot2 classes or data.frames", {
7070 if (! inherits(builds [[which(with(tests , ggObj & ggLayer ))[1 ]]], " ggproto" )){
7171 # # Current ggplot2 release version
7272 for (s in which(with(tests , ggObj & ggLayer ))) expect_is(builds [[s ]], " proto" , info = tinfo [s ])
73- for (s in which(with(tests , ggObj & ggLayer & anno ))) expect_equal(builds [[s ]]$ geom $ objname , " raster_ann" , info = tinfo [s ])
73+ for (s in which(with(tests , ggObj & ggLayer & anno ))) expect_equal(builds [[s ]]$ geom $ objname , " raster_ann" , info = tinfo [s ])
7474 for (s in which(with(tests , ggObj & ggLayer & ! anno ))) expect_equal(builds [[s ]]$ geom $ objname , " raster" , info = tinfo [s ])
7575 } else {
7676 # # Upcoming ggplot2 version (>=1.0.1.9002)
77- for (s in which(with(tests , ggObj & ggLayer & anno ))) expect_is(builds [[s ]]$ geom , " GeomRasterAnn" , info = tinfo [s ])
78- for (s in which(with(tests , ggObj & ggLayer & ! anno ))) expect_is(builds [[s ]]$ geom , " GeomRaster " , info = tinfo [s ])
77+ for (s in which(with(tests , ggObj & ggLayer & anno ))) expect_is(builds [[s ]]$ geom , " GeomRasterAnn" , info = tinfo [s ])
78+ for (s in which(with(tests , ggObj & ggLayer & ! anno ))) expect_is(builds [[s ]], " list " , info = tinfo [s ])
7979 }
8080
8181 # # Data.frames
0 commit comments