tests/testthat/test-lake_info.R

context("lake_info")

test_that("lake_info works", {
  dt <- readRDS("lagos_test_subset.rds")

  expect_equal(nrow(
    lake_info(name = "Benton Pond", state = "Massachusetts", dt = dt)), 1)

  # not in test dataset
  # expect_equal(nrow(
  #   lake_info(dt, lagoslakeid = 6302)), 1)

})

test_that("lake_info fails well", {
  dt <- readRDS("lagos_test_subset.rds")

  expect_error(lake_info(name = "gibberish", state = "Wisconsin", dt = dt),
               "Lake 'gibberish' in Wisconsin not found")

})
cont-limno/LAGOS documentation built on Nov. 9, 2018, 8:58 a.m.