tests/testthat/testthat-eq_location_clean.R

library(Rcapture)
library(testthat)
context("Testing that the eq_location_clean function runs correctly")

test_that("Location gets cleaned correctly", {
  df <- load_data() %>% eq_location_clean
  expect_true(all(df$LOCATION_NAME[1:2] == c("JORDAN:  BAB-A-DARAA,AL-KARAK", "SYRIA:  UGARIT")))
  expect_true(all(df$CLEAN_LOCATION_NAME[1:2] == c("Bab-A-Daraa,Al-Karak", "Ugarit")))
})
dannyjwpark/NOAA documentation built on Dec. 31, 2020, 11:11 p.m.