Skip to content

Commit

Permalink
Merge pull request #196 from jread-usgs/master
Browse files Browse the repository at this point in the history
the rest of #191 (url())
  • Loading branch information
Jordan S Read committed Aug 23, 2015
2 parents e6a57fd + 339221b commit b6df675
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
7 changes: 7 additions & 0 deletions R/url-generic.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ setMethod(f = "url<-",signature(.Object = "webprocess"), definition = function(.
.Object <- new(Class = "webprocess", url = value)
return(.Object)})

#'@aliases url
#'@rdname url
setMethod(f = "url",signature(.Object = "datagroup"),
definition = function(.Object){
return(sapply(.Object@group, function(x) x$url))
})

#'@aliases url
#'@rdname url
setMethod(f = "url",signature(.Object = "ANY"),
Expand Down
3 changes: 3 additions & 0 deletions man/url.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
\name{url<-}
\alias{url}
\alias{url,ANY-method}
\alias{url,datagroup-method}
\alias{url<-}
\alias{url<-,ANY-method}
\alias{url<-,webprocess-method}
Expand All @@ -18,6 +19,8 @@ url(.Object)

\S4method{url}{webprocess}(.Object) <- value

\S4method{url}{datagroup}(.Object)

\S4method{url}{ANY}(.Object)
}
\arguments{
Expand Down
14 changes: 14 additions & 0 deletions tests/testthat/test-query_webdatasets.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,17 @@ test_that("webdata query returns a list", {
wd <- webdata(datasets[4])
expect_is(query(wd,'variables'), 'character')
})

test_that("webdata title returns a title", {
expect_is(title(datasets[4]), 'character')
})

test_that("webdata url returns a url", {
expect_is(url(datasets[4]), 'character')
expect_is(url(datasets[4:5]), 'character')
})


test_that("webdata abstract returns an abstract", {
expect_is(url(datasets[4]), 'character')
})

0 comments on commit b6df675

Please sign in to comment.