tests/testthat/testplotfuns.R

context("Testing plotting functions")
library(ggplot2)


test_that("Plotting function works correctly", {

  plot1 <- ggplot(mtcars, aes(cyl, mpg))
  save_plot_png(plot1, "testplot")

  expect_true(file.exists("./Plots/testplot.png"))

})
AndBooth/Rutils documentation built on May 28, 2019, 11:04 a.m.