diff --git a/R/assert_set.R b/R/assert_set.R index 57f751b..528e01b 100644 --- a/R/assert_set.R +++ b/R/assert_set.R @@ -16,7 +16,7 @@ assert_subset <- assert_create( func = is_subset, default_error_msg = c( - x = "'{.strong {arg_name}}' {cli::qty(length(setopts_exlusive_to_first(arg_value, y)))} contain{?s} {?an/} invalid value{?s}: {.strong {setopts_exlusive_to_first(arg_value, y)}}. Valid values include: {unique(y)}" + x = "'{.strong {arg_name}}' {cli::qty(length(setopts_exlusive_to_first(arg_value, y)))} contains {?an/} invalid value{?s}: {.strong {setopts_exlusive_to_first(arg_value, y)}}. Valid values include: {unique(y)}" ) ) diff --git a/README.Rmd b/README.Rmd index 168ef5c..ef2010e 100644 --- a/README.Rmd +++ b/README.Rmd @@ -23,7 +23,6 @@ knitr::opts_chunk$set( [![Closed issues](https://img.shields.io/github/issues-closed/selkamand/assertions.svg)](https://github.com/selkamand/assertions/issues?q=is%3Aissue+is%3Aclosed) [![](http://cranlogs.r-pkg.org/badges/last-month/assertions)](https://cran.r-project.org/package=assertions) [![](http://cranlogs.r-pkg.org/badges/grand-total/assertions)](https://cran.r-project.org/package=assertions) -[![Codecov test coverage](https://codecov.io/gh/selkamand/assertions/graph/badge.svg)](https://app.codecov.io/gh/selkamand/assertions) @@ -52,11 +51,13 @@ install.packages("assertions") ### Development version -To get a bug fix or to use a feature from the development version, you can install the development version of assertions from GitHub. +You can install the development version of assertions from GitHub by running: ``` r -# install.packages('remotes') -remotes::install_github('selkamand/assertions') +if (!require("remotes", quietly = TRUE)) + install.packages("remotes") + +remotes::install_github("selkamand/assertions") ``` ## Quick Start diff --git a/README.md b/README.md index 8f9408d..6a83880 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,6 @@ [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) -[![Codecov test -coverage](https://codecov.io/gh/selkamand/assertions/branch/main/graph/badge.svg)](https://app.codecov.io/gh/selkamand/assertions?branch=main) [![R-CMD-check](https://github.com/selkamand/assertions/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/selkamand/assertions/actions/workflows/R-CMD-check.yaml) [![](https://img.shields.io/github/languages/code-size/selkamand/assertions.svg)](https://github.com/selkamand/assertions) [![](https://img.shields.io/github/last-commit/selkamand/assertions.svg)](https://github.com/selkamand/assertions/commits/main) @@ -16,9 +14,7 @@ coverage](https://codecov.io/gh/selkamand/assertions/branch/main/graph/badge.svg issues](https://img.shields.io/github/issues-closed/selkamand/assertions.svg)](https://github.com/selkamand/assertions/issues?q=is%3Aissue+is%3Aclosed) [![](http://cranlogs.r-pkg.org/badges/last-month/assertions)](https://cran.r-project.org/package=assertions) [![](http://cranlogs.r-pkg.org/badges/grand-total/assertions)](https://cran.r-project.org/package=assertions) -[![Codecov test -coverage](https://codecov.io/gh/selkamand/assertions/graph/badge.svg)](https://app.codecov.io/gh/selkamand/assertions) -[![R-CMD-check](https://github.com/selkamand/assertions/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/selkamand/assertions/actions/workflows/R-CMD-check.yaml) + Simple assertions with sensible defaults and customisable error @@ -49,12 +45,14 @@ install.packages("assertions") ### Development version -To get a bug fix or to use a feature from the development version, you -can install the development version of assertions from GitHub. +You can install the development version of assertions from GitHub by +running: ``` r -# install.packages('remotes') -remotes::install_github('selkamand/assertions') +if (!require("remotes", quietly = TRUE)) + install.packages("remotes") + +remotes::install_github("selkamand/assertions") ``` ## Quick Start diff --git a/tests/testthat/_snaps/assert_set.md b/tests/testthat/_snaps/assert_set.md index 5451e07..a30615d 100644 --- a/tests/testthat/_snaps/assert_set.md +++ b/tests/testthat/_snaps/assert_set.md @@ -28,7 +28,7 @@ assert_subset("def", "abc") Condition Error: - x '"def"' contain an invalid value: def. Valid values include: abc + x '"def"' contains an invalid value: def. Valid values include: abc --- @@ -36,7 +36,7 @@ assert_subset(c("A"), c(1, 2, 3)) Condition Error: - x 'c("A")' contain an invalid value: A. Valid values include: 1, 2, and 3 + x 'c("A")' contains an invalid value: A. Valid values include: 1, 2, and 3 # assert_one_of() works [plain]