Skip to content

Commit f540d58

Browse files
optionally skip tests requiring 'maps' (#5197)
* optionally skip tests requiring 'maps' * Update test-geom-hline-vline-abline.R * Update test-coord-map.R
1 parent bad001a commit f540d58

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

tests/testthat/test-annotate.r

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ test_that("segment annotations transform with scales", {
2929
})
3030

3131
test_that("annotation_* has dummy data assigned and don't inherit aes", {
32+
skip_if_not_installed("maps")
3233
skip_if(packageVersion("base") < "3.5.0")
3334
custom <- annotation_custom(zeroGrob())
3435
logtick <- annotation_logticks()

tests/testthat/test-coord-map.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
test_that("USA state map drawn", {
2+
skip_if_not_installed("maps") # required for map_data()
23
skip_if(packageVersion("base") < "3.5.0")
34
us_map <- map_data("usa")
45
p_us <- ggplot(us_map, aes(x = long, y = lat, group = group))
@@ -11,6 +12,7 @@ test_that("USA state map drawn", {
1112
})
1213

1314
test_that("coord_map scale position can be switched", {
15+
skip_if_not_installed("maps") # required for map_data()
1416
skip_if(packageVersion("base") < "3.5.0")
1517
us_map <- map_data("usa")
1618
p_us <- ggplot(us_map, aes(x = long, y = lat, group = group))
@@ -25,6 +27,7 @@ test_that("coord_map scale position can be switched", {
2527
})
2628

2729
test_that("Inf is squished to range", {
30+
skip_if_not_installed("maps") # required for mproject()
2831
skip_if(packageVersion("base") < "3.5.0")
2932
d <- cdata(
3033
ggplot(data_frame(x = 0, y = 0)) +

tests/testthat/test-geom-hline-vline-abline.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ test_that("check h/v/abline transformed on basic projections", {
2727
})
2828

2929
test_that("curved lines in map projections", {
30+
skip_if_not_installed("maps") # required for map_data()
3031
skip_if(packageVersion("base") < "3.5.0")
3132
nz <- subset(map_data("nz"), region == "North.Island ")
3233
nzmap <- ggplot(nz, aes(long, lat, group = group)) +

0 commit comments

Comments
 (0)