Skip to content

Commit

Permalink
testthat for as_api_object
Browse files Browse the repository at this point in the history
  • Loading branch information
jimrothstein committed Apr 19, 2024
1 parent bda5e25 commit 197d3aa
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/testthat/test-as.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
test_that("as_api_object() checks argument `x` ", {
expect_error(as_api_object())
expect_error(as_api_object(NULL))
expect_error(as_api_object(list()))

L <- list(a = "one") # named list
M <- c(a = "one") # named character vector
expect_error(as_api_object(L))
expect_error(as_api_object(M))
})

0 comments on commit 197d3aa

Please sign in to comment.