diff --git a/NAMESPACE b/NAMESPACE index 8345eff..776a200 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -53,7 +53,7 @@ importFrom(rlang,"%||%") importFrom(rlang,caller_arg) importFrom(rlang,caller_env) importFrom(rlang,check_dots_empty) +importFrom(stbl,stabilize_chr) importFrom(stbl,stabilize_chr_scalar) -importFrom(stbl,to_chr_scalar) importFrom(xml2,url_absolute) importFrom(yaml,read_yaml) diff --git a/R/components-security_scheme-oauth2-scopes.R b/R/components-security_scheme-oauth2-scopes.R index f2c3409..c1564fe 100644 --- a/R/components-security_scheme-oauth2-scopes.R +++ b/R/components-security_scheme-oauth2-scopes.R @@ -77,7 +77,7 @@ S7::method( ) <- function(x, ..., arg = caller_arg(x), call = caller_env()) { force(arg) x <- unlist(x) - x <- stbl::stabilize_chr(x, x_arg = arg) + x <- stabilize_chr(x, x_arg = arg) if (!rlang::is_named2(x)) { cli::cli_abort( "{.arg {arg}} must be a named character vector.", diff --git a/R/properties.R b/R/properties.R index 8184c05..21902c0 100644 --- a/R/properties.R +++ b/R/properties.R @@ -15,7 +15,7 @@ character_scalar_property <- function(x_arg, ...) { setter = function(self, value) { call <- caller_env(3) value <- value %||% character() - value <- stbl::stabilize_chr_scalar( + value <- stabilize_chr_scalar( value, allow_null = FALSE, x_arg = x_arg, @@ -40,7 +40,7 @@ enum_property <- function(x_arg) { value <- purrr::map( value, function(enumerations) { - enumerations <- stbl::stabilize_chr( + enumerations <- stabilize_chr( enumerations, allow_na = FALSE, x_arg = x_arg, @@ -69,7 +69,7 @@ list_of_characters <- function(x_arg, ...) { value, function(x) { x <- x %|0|% character() - stbl::stabilize_chr( + stabilize_chr( x, allow_na = FALSE, x_arg = x_arg, diff --git a/R/rapid-package.R b/R/rapid-package.R index 4a6e3f4..ed07195 100644 --- a/R/rapid-package.R +++ b/R/rapid-package.R @@ -8,8 +8,8 @@ #' @importFrom S7 class_missing #' @importFrom S7 prop #' @importFrom S7 prop<- +#' @importFrom stbl stabilize_chr #' @importFrom stbl stabilize_chr_scalar -#' @importFrom stbl to_chr_scalar #' @importFrom xml2 url_absolute #' @importFrom yaml read_yaml ## usethis namespace: end diff --git a/tests/testthat/test-components-security_scheme-oauth2-scopes.R b/tests/testthat/test-components-security_scheme-oauth2-scopes.R index 79e1845..01d41bc 100644 --- a/tests/testthat/test-components-security_scheme-oauth2-scopes.R +++ b/tests/testthat/test-components-security_scheme-oauth2-scopes.R @@ -65,6 +65,13 @@ test_that("as_scopes() errors informatively for bad classes", { ) }) +test_that("as_scopes() errors informatively for weird lists", { + expect_error( + as_scopes(list(a = mean)), + class = "stbl_error_coerce_character" + ) +}) + test_that("as_scopes() returns expected objects", { expect_identical( as_scopes(