tests/testthat/test-get_prices.R

test_that("get_prices works", {
  ticker <- sample(rfinance::get_sp500(), 1) # Get a random ticker
  prices <- rfinance::get_prices(ticker)
  testthat::expect_that(prices, testthat::is_a("data.frame"))
})

Try the rfinance package in your browser

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

rfinance documentation built on Oct. 26, 2021, 9:07 a.m.