tests/testthat/test-console.R

context("console functionality")

testthat::describe("console functionality", {
  skip_if_not_rstudio()
  rstudioapi::sendToConsole("x <- whereami()")

  it("class", {
    testthat::expect_true(inherits(x, c("whereami","character")))
  })

  it("value", {
    testthat::expect_equal(basename(x[1]), "Console")
  })

  #rstudioapi::sendToConsole("cat('\f')")
})

Try the whereami package in your browser

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

whereami documentation built on Dec. 28, 2022, 2:40 a.m.