From 3f0a3202b2a5fc16acbd1b1d450f9d593c1dd902 Mon Sep 17 00:00:00 2001 From: Mikko Korpela Date: Wed, 2 May 2018 11:50:46 +0300 Subject: [PATCH] Test that printing works, fix getFakeMap() --- tests/testthat/test-ggmap.R | 4 ++-- tests/testthat/util.R | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/testthat/test-ggmap.R b/tests/testthat/test-ggmap.R index 82d1376..b6795e2 100644 --- a/tests/testthat/test-ggmap.R +++ b/tests/testthat/test-ggmap.R @@ -3,7 +3,7 @@ source("util.R") test_that("ggmap example works", { map <- getFakeMap() - ggmap(map) + print(ggmap(map)) expect_true(TRUE) # didn't stop: good! }) @@ -12,7 +12,7 @@ test_that("ggmapplot example works", { expect_warning( # deprecated, and uses deprecated syntax # warns twice - ggmapplot(map) + print(ggmapplot(map)) ) expect_true(TRUE) # didn't stop: good! }) diff --git a/tests/testthat/util.R b/tests/testthat/util.R index 5067ee3..d26aca1 100644 --- a/tests/testthat/util.R +++ b/tests/testthat/util.R @@ -1,5 +1,5 @@ getFakeMap <- function() { - map <- character() + map <- matrix("#000000") class(map) <- c('ggmap','raster') attr(map, "source") <- "osm" attr(map, "maptype") <- "openstreetmap" @@ -9,4 +9,4 @@ getFakeMap <- function() { ur.lat = 3, ur.lon = 4 ) map -} \ No newline at end of file +}