Skip to content

Commit ecf582c

Browse files
authored
Merge pull request #131 from MichaelChirico/sugg-alluvial
Optionally skip tests when Suggests dep 'alluvial' is not installed
2 parents 5b42a51 + 58bbdc4 commit ecf582c

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

tests/testthat/test-geom-alluvium.r

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
# visual tests
22

33
test_that("`geom_alluvium` draws correctly", {
4+
skip_on_cran()
5+
skip_if_not_installed("vdiffr")
6+
skip_if_not_installed("alluvial")
7+
48
d1 <- as.data.frame(Titanic)
59
a1 <- aes(y = Freq, axis1 = Class, axis2 = Sex, axis3 = Age, fill = Survived)
610
a2 <- aes(y = Freq, axis1 = Class, axis2 = Sex)
711
d2 <- alluvial::Refugees
812
a3 <- aes(y = refugees, x = year, alluvium = country)
913

10-
skip_on_cran()
11-
skip_if_not_installed("vdiffr")
1214
vdiffr::expect_doppelganger(
1315
"`geom_alluvium`: basic",
1416
ggplot(d1, a1) + geom_alluvium()

tests/testthat/test-stat-alluvium.r

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ test_that("`stat_alluvium` orders alluvia correctly according to `aes.bind`", {
8181
# exceptional data
8282

8383
test_that("`stat_flow` handles exceptional data with out errors", {
84+
skip_if_not_installed("alluvial")
8485
data(Refugees, package = "alluvial")
8586
refugees_sub <- subset(Refugees, year %in% c(2003, 2005, 2010, 2013))
8687
gg <- ggplot(refugees_sub, aes(x = year, y = refugees, alluvium = country)) +

0 commit comments

Comments
 (0)