Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion R/assert_set.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)}"
)
)

Expand Down
9 changes: 5 additions & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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)

<!-- badges: end -->

Expand Down Expand Up @@ -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
Expand Down
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,14 @@

[![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)
[![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)
[![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)

<!-- badges: end -->

Simple assertions with sensible defaults and customisable error
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/_snaps/assert_set.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
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

---

Code
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]

Expand Down