tests/testthat/test_ggwrap.R

context("ggwrap")

test_that("ggwrap runs without error", {
  plot <- ggplot2::ggplot(
    ggplot2::economics,
    ggplot2::aes(x = date, y = unemploy)
  ) + 
    ggplot2::geom_line()
  expect_silent(ggwrap(plot, 4))
  expect_silent(ggwrap(plot, 40))
})

context("printggwrap")

test_that("print.ggwrap runs without error", {
  plot <- ggplot2::ggplot(
    ggplot2::economics,
    ggplot2::aes(x = date, y = unemploy)
  ) + 
    ggplot2::geom_line()
  plot <- ggwrap(plot, 4)
  expect_silent(plot)
})
wilkox/ggwrap documentation built on May 21, 2019, 12:22 p.m.