From 20c2d89035fc32acde9de75e8a6e9c10d4128579 Mon Sep 17 00:00:00 2001 From: Samantha Toet Date: Wed, 13 Mar 2019 22:42:42 -0400 Subject: [PATCH 1/2] moved CONTRIBUTING into README --- CONTRIBUTING.md | 9 --------- README.Rmd | 13 +++++++++++++ README.md | 15 +++++++++++++++ 3 files changed, 28 insertions(+), 9 deletions(-) delete mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index b0214aa..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,9 +0,0 @@ -We happily accept contributions to our collection of bingo cards! If you'd like to add a card, simply submit a [pull request](https://help.github.com/articles/using-pull-requests) following these guidelines: -- Create an R file under the [`inst/topics/`](./inst/topics/) directory -- The name of the R file will be used as the name of the topic of bingo cards -- The file should return a character vector containing the words or phrases to put in the squares -- There should be at least 24 squares, in order to make 5 x 5 bingo cards -- Optional: at the top of the file, add your name and a short description of the card as a comment -- You can look at the [existing examples](./inst/topics/) - -We'll try to be as responsive as possible in reviewing and accepting pull requests. We appreciate your contributions! diff --git a/README.Rmd b/README.Rmd index 441e6a5..749c1e1 100644 --- a/README.Rmd +++ b/README.Rmd @@ -105,3 +105,16 @@ To run [the app we're running remotely](http://daattali.com/shiny/bingo/) on you launch() ``` + +## Contribute your own squares + +We happily accept contributions to our collection of bingo cards! If you'd like to add a card, simply submit a [pull request](https://help.github.com/articles/using-pull-requests) following these guidelines: + +- Create an R file under the [`inst/topics/`](./inst/topics/) directory +- The name of the R file will be used as the name of the topic of bingo cards +- The file should return a character vector containing the words or phrases to put in the squares +- **There should be at least 24 squares**, in order to make 5 x 5 bingo cards. +- Optional: at the top of the file, add your name and a short description of the card as a comment +- You can look at the [existing examples](./inst/topics/) + +We'll try to be as responsive as possible in reviewing and accepting pull requests. We appreciate your contributions! diff --git a/README.md b/README.md index e3041a5..8040701 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ - [SuperBowl Example](#superbowl-example) - ["Open" and Bad Data Examples](#open-and-bad-data-examples) - [Run Shiny app locally](#run-shiny-app-locally) + - [Contribute your own squares](#contribute-your-own-squares) bingo @@ -118,3 +119,17 @@ To run [the app we're running remotely](http://daattali.com/shiny/bingo/) on you ``` r launch() ``` + +Contribute your own squares +--------------------------- + +We happily accept contributions to our collection of bingo cards! If you'd like to add a card, simply submit a [pull request](https://help.github.com/articles/using-pull-requests) following these guidelines: + +- Create an R file under the [`inst/topics/`](./inst/topics/) directory +- The name of the R file will be used as the name of the topic of bingo cards +- The file should return a character vector containing the words or phrases to put in the squares +- **There should be at least 24 squares**, in order to make 5 x 5 bingo cards. +- Optional: at the top of the file, add your name and a short description of the card as a comment +- You can look at the [existing examples](./inst/topics/) + +We'll try to be as responsive as possible in reviewing and accepting pull requests. We appreciate your contributions! From c555fd1296bb6d86991da1deb70d7a1f548907ce Mon Sep 17 00:00:00 2001 From: Samantha Toet Date: Wed, 13 Mar 2019 22:46:19 -0400 Subject: [PATCH 2/2] testing the length of a topic --- tests/testthat/test-package.R | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/testthat/test-package.R b/tests/testthat/test-package.R index 5c74dc9..03ef389 100644 --- a/tests/testthat/test-package.R +++ b/tests/testthat/test-package.R @@ -4,3 +4,9 @@ test_that("duplicate squares are removed", { x <- c("a", "a", "b") expect_identical(c("a", "b"), vet_squares(x)) }) + + +test_that("each topic contains 24+ unique values", { + x <- letters[1:23] + expect_error(bingo(words = x), "m >= n_sq is not TRUE") +})