test_that("get_headlines returns a data frame with one column", {
# adding a small time delay to avoid simultaneous posts to the api
Sys.sleep(3)
# Skip when tests are run on CRAN
skip_on_cran()
# Get the news
output_headlines <- get_headlines("ycombinator.com")
# What's returned
expect_s3_class(output_headlines, "data.frame")
expect_equal(ncol(output_headlines), 1)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.