diff --git a/tests/testthat/test-as.R b/tests/testthat/test-as.R new file mode 100644 index 0000000..7948933 --- /dev/null +++ b/tests/testthat/test-as.R @@ -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)) +})