tests/testthat/test-logs.R

test_that("get_gargoyle_logs() works", {
  expect_equal(
    nrow(get_gargoyle_logs()),
    0
  )
  expect_equal(
    names(get_gargoyle_logs()),
    c("what", "time")
  )
  .logs$log <- rbind(
    .logs$log,
    data.frame(
      what = c("this"),
      time = as.character(Sys.time()),
      stringsAsFactors = FALSE
    )
  )
  expect_equal(
    nrow(get_gargoyle_logs()),
    1
  )
  expect_equal(
    names(get_gargoyle_logs()),
    c("what", "time")
  )
})

Try the gargoyle package in your browser

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

gargoyle documentation built on Feb. 25, 2021, 5:07 p.m.