tests/testthat/test-search.R

test_that("search_comments", {
  vcr::use_cassette("search_comments_default", {
    x <- search_comments(q = "cats", size = 100,verbose = FALSE)
  })
  expect_true(nrow(x) == 100)
  expect_true("tbl_df" %in% class(x))
})

test_that("search_submissions", {
  vcr::use_cassette("search_submissions_default", {
    x <- search_submissions(q = "dogs", subreddit = "animals", size = 10,verbose = FALSE)
  })
  expect_true(nrow(x) == 10)
  expect_true("tbl_df" %in% class(x))
})

Try the PSAWR package in your browser

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

PSAWR documentation built on March 7, 2023, 6:59 p.m.