tests/testthat/test-eg.R

context("authentication")

test_that("session validation works appropriately", {
  expect_false(session_validate(5))
	#expect_null(current_session())
	session <- httr::handle("http://google.com")
	attributes(session) <- c(attributes(session), list(birthdate=Sys.time()))
	expect_true(session_validate(session))
	set_expiration(as.difftime("00:00:01"))
	Sys.sleep(2)
	expect_false(session_validate(session))
	
})

Try the sbtools package in your browser

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

sbtools documentation built on May 29, 2017, 7:40 p.m.