Skip to content
This repository has been archived by the owner on May 5, 2020. It is now read-only.

Commit

Permalink
add cpuwww function and test
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentGatto committed Jan 1, 2017
1 parent 05b3822 commit 5c15f16
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 3 deletions.
8 changes: 7 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ Maintainer: Laurent Gatto <[email protected]>
Description: Miscellaneous helper functions aimed at facilitating and
standardising simple repetitive tasks.
Imports: grDevices, graphics, utils, scales
Suggests: testthat
Suggests:
testthat,
BiocStyle,
httr,
knitr,
rmarkdown
License: GPL-3
RoxygenNote: 5.0.1
VignetteBuilder: knitr
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ importFrom("utils", "head", "tail")
importFrom("scales", "col2hcl")


export(cputools,
export(cputools, cpuwww,
biocVersions,
makeTravisShield, makeCodecovShield,
makeBiocBuildShield, makeBiocCovrShield,
Expand Down
10 changes: 10 additions & 0 deletions R/cpu.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
##' Return the CPU webpage url.
##'
##' @title Return the CPU webpage url.
##' @return The URL as a \code{character}
##' @author Laurent Gatto
##' @rdname
##' @examples
##' cpuwww()
cpuwww <- function()
"[Computational Proteomics Unit](http://cpu.sysbiol.cam.ac.uk/)"
21 changes: 21 additions & 0 deletions man/cpuwww.Rd

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

3 changes: 2 additions & 1 deletion tests/testthat/test_biocVersions.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
test_that("cputools", {
test_that("Bioconductor version numbers", {
v <- biocVersions()
## update me for every new release
v0 <- c("3.4", "3.5")
names(v0) <- c("release", "devel")
expect_identical(v, v0)
})

10 changes: 10 additions & 0 deletions tests/testthat/test_cpu.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
context("Computational Proteomics Unit")

test_that("CPU www", {
x <- cpuwww()
expect_identical(x,
"[Computational Proteomics Unit](http://cpu.sysbiol.cam.ac.uk/)")
url <- gsub("^.+\\((.+)\\)", "\\1", x)
got <- httr::GET(url)
expect_identical(got, stop_for_status(got))
})

0 comments on commit 5c15f16

Please sign in to comment.