tests/testthat/test-deprecated.R

test_that("Deprecated arguments", {

  dat <- data.frame(event = 1:2, start = c("2019-01-05", "2019-01-06"))

  expect_warning(vistime(dat, start = "start"), "deprecated")
  expect_warning(vistime(dat, end = "end"), "deprecated")
  expect_warning(vistime(dat, colors = "bla"), "deprecated")
  expect_warning(vistime(dat, groups = "custom_group_col"), "deprecated")
  expect_warning(vistime(dat, tooltips = "start"), "deprecated")
})

test_that("Unknown arguments", {

  dat <- data.frame(event = 1:2, start = c("2019-01-05", "2019-01-06"))

  expect_message(vistime(dat, arg1 = "bla"), "unexpected arguments")
  expect_message(vistime(dat, arg1 = "bla", arg2 = "blubb"), "unexpected arguments")
})

Try the vistime package in your browser

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

vistime documentation built on Nov. 2, 2023, 5:23 p.m.