tests/testthat/test_plot_body.R

context("plot_body")

test_that("plot_body returns a function", {
  expect_is(plot_body(map), "function")
})

test_that("plot_body gives errors for primitive functions", {
  expect_error(plot_body(sum))
  expect_error(plot_body(round))
})

test_that("plot_body gives warnings for long functions", {
  expect_warning(plot_body(data.frame))
})

test_that("plot_body gives error when used with  :: operator", {
  expect_error(plot_body(purrr::map))
})

Try the frite package in your browser

Any scripts or data that you put into this service are public.

frite documentation built on July 1, 2018, 5:04 p.m.