Skip to content

Commit

Permalink
Test that country names are interpreted
Browse files Browse the repository at this point in the history
  • Loading branch information
joeroe committed Dec 21, 2022
1 parent 3d69f9d commit a4e7fab
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/testthat/test-chron.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,14 @@ test_that("chron_data() prompts for confirmation if `.everything` isn't set", {
mockery::stub(chron_data, "utils::askYesNo", FALSE)
expect_null(chron_data())
})

test_that("chron_data() can interpret country names", {
mockery::stub(xronos_query, "xronos_request", return, depth = 2)

expect_equal(chron_data(country = c("CH", "DE")),
chron_data(country = c("Switzerland", "Germany")))
expect_equal(chron_data(country = c("CH", "Germany")),
chron_data(country = c("Switzerland", "DE")))
expect_error(chron_data(country = c("CH", "DE", "Nonsuch Palace")),
class = "xronos_invalid_request")
})

0 comments on commit a4e7fab

Please sign in to comment.