tests/testthat/test-whatis.R

test_that("HAPPY: whatis returns results", {
  vcr::use_cassette("whatis-happy-return-results", {
    good <- with_stubbed_credentials({
      with_stubbed_credentials({
        air::whatis("paste0(vector1, vector2)") |> suppressMessages()
      })
    })
  })
  expect_true(class(good) == "character")
})

test_that("HAPPY: whatis prints result message", {
  good <- \() {
    vcr::use_cassette("whatis-happy-print-results", {
      with_stubbed_credentials({
        air::whatis("paste0(vector1, vector2)")
      })
    })
  }

  expect_message(good(), ".*\n+")
})

Try the air package in your browser

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

air documentation built on Aug. 8, 2025, 6:46 p.m.