tests/testthat/test_mentions.R

context("mentions")

test_that("mentions returns tweets data", {
  skip_on_cran()

  token <- readRDS("twitter_tokens")
  x <- get_mentions(token = token)

  expect_equal(is.data.frame(x), TRUE)
  expect_named(x)
  expect_true("status_id" %in% names(x))
  expect_gt(nrow(x), 2)
  expect_gt(ncol(x), 2)
})

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.