tests/testthat/test-ts_plot.R

test_that("ts_plot works", {
  vcr::use_cassette("ts_plot1", {
    rt <- search_tweets("rstats", n = 100)
  })
  expect_error(ts_plot(rt), NA)
})

test_that("ts_data works", {
  vcr::use_cassette("ts_plot2", {
    rt <- search_tweets("rstats", n = 100)
  })
  expect_error(ts_data(rt), NA)
})

test_that("ts_plot grouped works", {
  skip_if_not_installed("dplyr")
  vcr::use_cassette("ts_plot3", {
    rt <- search_tweets("rstats", n = 100)
  })
  grouped <- dplyr::group_by(rt, is_quote_status)
  expect_error(ts_plot(grouped), NA)
})

Try the rtweet package in your browser

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

rtweet documentation built on Oct. 17, 2023, 1:11 a.m.