tests/testthat/test-tibble_creation.R

context("tibble creation")

test_that("getcomics ", {
  df <- get_comic(comic = 614)
  expect_true(inherits(df, "tbl"))
  expect_true(inherits(df, "tbl_df"))
  expect_true(inherits(df, "data.frame"))
  expect_equal(nrow(df), 1)
  expect_equal(ncol(df), 11)
  expect_error(get_comic("abs"))
})

test_that("printxkcd works", {
  expect_error(print_xkcd("abs"))
})

Try the XKCDdata package in your browser

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

XKCDdata documentation built on May 2, 2019, 1:26 p.m.