Skip to content

Commit

Permalink
Merge pull request #72 from ropensci/devel
Browse files Browse the repository at this point in the history
Increase test coverage, includes update_station_list()
  • Loading branch information
adamhsparks authored Sep 4, 2019
2 parents 50eefc0 + f53c9a5 commit b137503
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 4 deletions.
4 changes: 2 additions & 2 deletions R/GSODR-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#'
#' @name GSODR
#'
#' @author Adam Sparks, Tomislav Hengl and Andrew Nelson
#' @author Adam H. Sparks, Tomislav Hengl and Andrew Nelson
#'
#' @seealso
#'
Expand All @@ -54,7 +54,7 @@
#'
#' \strong{Useful links:}
#' \itemize{
#' \item{Static documentation at \url{https://ropensci.github.io/GSODR/}}
#' \item{Static documentation at \url{https://docs.ropensci.org/GSODR/}}
#' \item{Development repository at \url{https://github.com/ropensci/GSODR}}
#' \item{Report bugs at \url{https://github.com/ropensci/GSODR/issues}}
#' }
Expand Down
4 changes: 2 additions & 2 deletions man/GSODR.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions tests/testthat/test-update_station_list.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,34 @@ test_that("If user selects no, database not updated", {
options(GSODR_connection = stdin())
close(f)
})

# update_forecast_locations() d-loads, imports file and resets timeout on exit--
test_that("update_station_list() downloads and imports proper file", {
skip_on_cran()
f <- file()
options(GSODR_connection = f)
ans <- "yes"
write(ans, f)
expect_message(update_station_list())
load(system.file("extdata", "isd_history.rda", package = "GSODR"))
expect_equal(ncol(isd_history), 11)
expect_named(
isd_history,
c(
"STNID",
"NAME",
"LAT",
"LON",
"CTRY",
"STATE",
"BEGIN",
"END",
"COUNTRY_NAME",
"ISO2C",
"ISO3C"
)
)
expect_equal(options("timeout")[[1]], 60)
options(GSODR_connection = stdin())
close(f)
})

0 comments on commit b137503

Please sign in to comment.