library(spitcastr)
context("Test spot function")
id <- 1
df <- "data.frame"
chr <- "character"
srch <- "http://api.spitcast.com/api/spot-forecast/search?="
test_df <- spot(item = "neighbors", spot_id = id)
test_that("spot function throws errors for bad params", {
expect_error(spot(item = "foo"))
expect_error(spot(item = "forecast"))
expect_error(spot(item = "neighbors"))
expect_silent(spot(item = "all"))
expect_silent(spot())
expect_false("coordinates" %in% test_df)
})
test_that("spot function return proper types", {
expect_is(spot(item = "all"), df)
expect_is(spot(item = "forecast", spot_id = id), df)
expect_is(spot(item = "nearby"), df)
expect_is(spot(item = "neighbors", spot_id = id), df)
expect_is(spot(item = "top"), df)
expect_is(spot(item = "search"), df)
expect_is(spot(), df)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.