Skip to content

Commit

Permalink
Merge pull request #19 from Metropolitan-Council/18-add-iscall-to-par…
Browse files Browse the repository at this point in the history
…ameter-validation

Add is.call() to parameter validation
  • Loading branch information
eroten authored Dec 26, 2023
2 parents 9eb2215 + d9118f4 commit da9dcf0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Type: Package
Package: streetlightR
Title: Interact with StreetLight Data's API in R
Version: 1.2.0
Date: 2023-12-21
Version: 1.2.1
Date: 2023-12-26
Authors@R: c(
person("Metropolitan Council", role = "cph"),
person("Liz", "Roten", , "[email protected]", role = c("cre", "aut"),
Expand Down
6 changes: 3 additions & 3 deletions R/validate_parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ validate_parameters <- function(param,
"metric",
"country"
)) {
if (!is.character(value)) {
if (!is.character(value) & !is.call(value)) {
cli::cli_abort(paste0(
"Parameter {param} must be a string."
))
Expand All @@ -52,7 +52,7 @@ validate_parameters <- function(param,
"aadt_year",
"aadt_calibration_year"
)) {
if (!is.numeric(value)) {
if (!is.numeric(value) & !is.call(value)) {
cli::cli_abort(paste0(
"Parameter {param} must be numeric."
))
Expand All @@ -75,7 +75,7 @@ validate_parameters <- function(param,
"enable_completion_email",
"with_calibration"
)) {
if (!is.logical(value)) {
if (!is.logical(value) & !is.call(value)) {
cli::cli_abort(paste0(
"Parameter {param} must be a TRUE or FALSE"
))
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-create_tag.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ test_that("create tag testing", {
login_email = test_login,
"streetlightR"
) %>%
testthat::expect_warning("Tag names must be case-insensitive unique.")
testthat::expect_warning("Tag names must be case-insensitive")
})

0 comments on commit da9dcf0

Please sign in to comment.