tests/testthat/test-request_generate.R

test_that("can generate a basic request", {
  req <- request_generate(
    "sheets.spreadsheets.get",
    list(spreadsheetId = "abc123"),
    token = NULL
  )
  expect_identical(req$method, "GET")
  expect_match(
    req$url,
    "^https://sheets.googleapis.com/v4/spreadsheets/abc123\\?key=.+"
  )
  expect_null(req$token)
})

Try the googlesheets4 package in your browser

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

googlesheets4 documentation built on July 9, 2023, 7:40 p.m.