test_that("lookup_geography requires search term", { expect_error( lookup_geography(), "Search term required" ) expect_error( lookup_geography(""), "Search term required" ) }) test_that("lookup_geography requires rsdmx package", { skip_if_not_installed("rsdmx") # If we get here, rsdmx IS installed, so skip this test skip("rsdmx is installed, cannot test error message") }) test_that("lookup_geography finds geographies", { skip_if_no_api() skip_on_cran() skip_if_not_installed("rsdmx") result <- lookup_geography("London") expect_s3_class(result, "tbl_df") # May be empty but should not error }) test_that("lookup_geography handles no matches gracefully", { skip_if_no_api() skip_on_cran() skip_if_not_installed("rsdmx") # FIXED: This might warn, not message expect_warning( result <- lookup_geography("ZZZZNONEXISTENT9999"), "Geography search failed|No matches" ) # Should return empty tibble expect_s3_class(result, "tbl_df") })