with_mock_dir("mm_get", { test_that("mm_get() returns a tibble", { skip_on_cran() got <- mm_get("status") expect_s3_class(got, "tbl_df") expect_named(got, c("ampc_required", "description", "status")) }) }) with_mock_dir("statuses", { test_that("mm_get() returns informative error on invalid endpoint", { skip_on_cran() expect_error( mm_get("statuses"), regexp = "This is not a valid web API endpoint." ) }) }) with_mock_dir("status_col_info", { test_that("mm_get_col_info() returns column names and info", { skip_on_cran() got <- mm_get_col_info("status") expect_s3_class(got, "tbl_df") expect_named(got, c("field", "filter_enabled", "description", "type")) }) }) with_mock_dir("status_col_info", { test_that("mm_get_criteria() returns field and description columns", { skip_on_cran() got <- mm_get_criteria("status") expect_s3_class(got, "tbl_df") expect_named(got, c("field", "description")) }) }) with_mock_dir("status_col_info", { test_that("mm_get_schema() returns field, description, and type columns", { skip_on_cran() got <- mm_get_schema("status") expect_s3_class(got, "tbl_df") expect_named(got, c("field", "description", "type")) }) }) with_mock_dir("status_labels", { test_that("mm_get_labels() returns field and description columns", { skip_on_cran() got <- mm_get_labels("status") expect_s3_class(got, "tbl_df") expect_named(got, c("field", "description")) }) })