From 8eb5ed1a28bc2bd6e919ecbe96b63822ee0330c7 Mon Sep 17 00:00:00 2001 From: boB Rudis Date: Tue, 5 Dec 2017 13:55:05 -0500 Subject: [PATCH] travis --- .Rbuildignore | 2 +- .travis.yml | 26 ++++---------------------- DESCRIPTION | 3 ++- README.Rmd | 2 ++ README.md | 1 + tests/test-all.R | 2 ++ tests/testthat/test-statebins.R | 22 +++++++++++++++++++++- 7 files changed, 33 insertions(+), 25 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index 5db1bc9..158f97e 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -12,4 +12,4 @@ ^cran-comments\.md$ ^README.gfm-ascii_identifiers_files$ ^README.gfm-ascii_identifiers_files/$ -^README.gfm-ascii_identifiers_files/.*$ \ No newline at end of file +^README.gfm-ascii_identifiers_files/.*$ diff --git a/.travis.yml b/.travis.yml index cf8c99a..8d139ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,23 +1,5 @@ -language: c +# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r -before_install: - - curl -OL http://raw.github.com/craigcitro/r-travis/master/scripts/travis-tool.sh - - chmod 755 ./travis-tool.sh - - ./travis-tool.sh bootstrap - -install: - - ./travis-tool.sh install_github plyr - - ./travis-tool.sh install_deps - -script: ./travis-tool.sh run_tests - -on_failure: - - ./travis-tool.sh dump_logs - -branches: - except: - - /-expt$/ - notifications: - email: - on_success: change - on_failure: change +language: R +sudo: false +cache: packages diff --git a/DESCRIPTION b/DESCRIPTION index bc34634..d5fc05d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -28,7 +28,8 @@ License: MIT + file LICENSE Suggests: testthat, viridis, - RColorBrewer + RColorBrewer, + cdcfluview Depends: R (>= 3.2.0), Imports: diff --git a/README.Rmd b/README.Rmd index f721139..eafd77a 100644 --- a/README.Rmd +++ b/README.Rmd @@ -8,6 +8,8 @@ knitr::opts_chunk$set(message=FALSE, warning=FALSE, fig.retina=2) options(width=120) ``` +[![Travis-CI Build Status](https://travis-ci.org/hrbrmstr/statebins.svg?branch=master)](https://travis-ci.org/hrbrmstr/statebins) + # statebins Create 'U.S.' Uniform Square State Cartogram Heatmaps diff --git a/README.md b/README.md index 2b771fb..f78f207 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[![Travis-CI Build Status](https://travis-ci.org/hrbrmstr/statebins.svg?branch=master)](https://travis-ci.org/hrbrmstr/statebins) # statebins diff --git a/tests/test-all.R b/tests/test-all.R index 5412d76..306272d 100644 --- a/tests/test-all.R +++ b/tests/test-all.R @@ -1,2 +1,4 @@ library(testthat) +library(ggplot2) + test_check("statebins") diff --git a/tests/testthat/test-statebins.R b/tests/testthat/test-statebins.R index ab6f62f..90fb1fa 100644 --- a/tests/testthat/test-statebins.R +++ b/tests/testthat/test-statebins.R @@ -1,6 +1,26 @@ context("basic functionality") test_that("we can do something", { - #expect_that(some_function(), is_a("data.frame")) + require(ggplot2) + + flu <- cdcfluview::ili_weekly_activity_indicators(2017) + + ggplot(flu, aes(state=statename, fill=activity_level)) + + geom_statebins() + + coord_equal() + + ggplot2::facet_wrap(~weekend) + + labs(title="2017-18 Flu Season ILI Activity Level") + + theme_statebins() -> gg + + gb <- ggplot_build(gg) + + data(USArrests) + + USArrests$state <- rownames(USArrests) + + statebins(USArrests, value_col="Assault", name = "Assault") + + theme_statebins(legend_position="right") -> gg + + gb <- ggplot_build(gg) })