tests/testthat/test_tweet_shot.R

context("tweet_shot")

test_that("tweet_shot", {
  skip_on_cran()
  has_phantom <- function() {
    x <- suppressMessages(webshot:::find_phantom())
    length(x) == 1 && x != ""
  }
  if (requireNamespace("webshot", quietly = TRUE)) {
    tw <- rtweet::tweet_shot("https://twitter.com/jhollist/status/947082036019388416")
    expect_equal(class(tw), "magick-image")
    expect_equal(length(tw), 1L)
  }
})

Try the rtweet package in your browser

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

rtweet documentation built on Jan. 11, 2020, 9:11 a.m.