diff --git a/DESCRIPTION b/DESCRIPTION index 47d5239..5e17dca 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -6,6 +6,12 @@ Maintainer: Laurent Gatto 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 diff --git a/NAMESPACE b/NAMESPACE index ed357c9..8323a2b 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -5,7 +5,7 @@ importFrom("utils", "head", "tail") importFrom("scales", "col2hcl") -export(cputools, +export(cputools, cpuwww, biocVersions, makeTravisShield, makeCodecovShield, makeBiocBuildShield, makeBiocCovrShield, diff --git a/R/cpu.R b/R/cpu.R new file mode 100644 index 0000000..b6726aa --- /dev/null +++ b/R/cpu.R @@ -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/)" diff --git a/man/cpuwww.Rd b/man/cpuwww.Rd new file mode 100644 index 0000000..18f7601 --- /dev/null +++ b/man/cpuwww.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/cpu.R +\name{cpuwww} +\alias{cpuwww} +\title{Return the CPU webpage url.} +\usage{ +cpuwww() +} +\value{ +The URL as a \code{character} +} +\description{ +Return the CPU webpage url. +} +\examples{ +cpuwww() +} +\author{ +Laurent Gatto +} + diff --git a/tests/testthat/test_biocVersions.R b/tests/testthat/test_biocVersions.R index a268d65..488eaa8 100644 --- a/tests/testthat/test_biocVersions.R +++ b/tests/testthat/test_biocVersions.R @@ -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) }) + diff --git a/tests/testthat/test_cpu.R b/tests/testthat/test_cpu.R new file mode 100644 index 0000000..0e6d399 --- /dev/null +++ b/tests/testthat/test_cpu.R @@ -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)) +})