tests/testthat/test_current.R

context("Testing Current functionality")

test_that("Testing if current weather function gives correct output", {

  key = "ba435151893f4b833c9b27ca6f28044f"
  res = weatherstack_current(key, "New York", 'f')

  expect_equal(res[6], 'United States of America')
  expect_equal(res[7], 'New York')
  expect_equal(res[10], 'America/New_York')

})
Yuening-Li/weatherstack documentation built on Feb. 16, 2020, 5:42 a.m.