tests/testthat/test-my_theme.R

test_that("output is ggplot2 object", {
library(ggplot2)
  df <- data.frame(x = 1:10, y =1:10)

 fig <- ggplot2::ggplot(df, ggplot2::aes(x, y)) +
   ggplot2::geom_line()

 testthat::expect_true(ggplot2::is.ggplot(my_theme(fig)))

})
etc5523-2020/r-package-assessment-petestylianos documentation built on Jan. 1, 2021, 1:12 a.m.