Skip to content

Commit

Permalink
skip tests on old versions
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasp85 committed May 6, 2024
1 parent e665bcb commit 7b2acc5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/testthat/test-element_marquee.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
test_that("element_marquee() inserts aesthetics into the style", {

skip_if_not(getRversion() >= "4.3")

elem <- element_marquee("serif", colour = "red", size = 6, margin = ggplot2::margin(1, 1, 1, 1))
elem <- element_grob.element_marquee(elem, "test", hjust = "left", vjust = "center", margin_x = TRUE, margin_y = TRUE)
expect_equal(elem$text$family[1], "serif")
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-geom_marquee.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
test_that("geom_marquee inserts the aesthetics correctly", {

skip_if_not(getRversion() >= "4.3")

p <- ggplot2::ggplot(mtcars) +
geom_marquee(ggplot2::aes(disp, mpg, label = gear), family = "serif", size = 6, color = "red", fill = "blue", size.unit = "Pt")
p <- ggplot2::ggplotGrob(p)
Expand Down
6 changes: 6 additions & 0 deletions tests/testthat/test-grob.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
test_that("grobs gets correctly constructed", {

skip_if_not(getRversion() >= "4.3")

grob1 <- marquee_grob(markdown_test, classic_style(lineheight = 1.1))
expect_s3_class(grob1, "marquee_grob")
expect_false(inherits(grob1, "marquee_precalculated_grob"))
Expand Down Expand Up @@ -39,6 +42,9 @@ test_that("grobs gets correctly constructed", {
})

test_that("grob looks as it should (sadly too complex to test other way)", {

skip_if_not(getRversion() >= "4.3")

grob1 <- marquee_grob(markdown_test, classic_style(lineheight = 1.1))

skip_on_os("windows")
Expand Down

0 comments on commit 7b2acc5

Please sign in to comment.