tests/testthat/test-delete.R

test_that("multiplication works", {
  jar <- options(cookie_dir = tempdir())
  expect_equal({
    add_cookies(cookiestring = "test=true; success=yes", domain = "tests.com")
    get_cookies("^tests.com", as = "string")
  }, "test=true; success=yes")

  expect_equal({
    add_cookies(cookiestring = "test=true; success=yes", domain = "tests.com")
    delete_cookies("^tests.com", ask = FALSE)
    get_cookies("^tests.com", as = "string")
  }, "")
})

Try the cookiemonster package in your browser

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

cookiemonster documentation built on May 29, 2024, 8:12 a.m.