|
1 | 1 | context("Test freegeoip") |
2 | 2 |
|
3 | | -test_that("data.frames can be returned", { |
| 3 | +test_that("data.frames can be returned from freegeoip", { |
4 | 4 | result <- freegeoip("2607:FB90:426:DC1D:CFC4:4875:8BC2:4D93") |
5 | 5 | expect_that(is.data.frame(result), equals(TRUE)) |
6 | 6 | expect_that(nrow(result), equals(1)) |
7 | 7 | expect_that(ncol(result), equals(11)) |
8 | 8 | }) |
9 | 9 |
|
10 | | -test_that("Lists can be returned", { |
| 10 | +test_that("Lists can be returnedfrom freegeoip", { |
11 | 11 | result <- freegeoip("2607:FB90:426:DC1D:CFC4:4875:8BC2:4D93", FALSE) |
12 | 12 | expect_that(is.list(result), equals(TRUE)) |
13 | 13 | expect_that(length(result), equals(1)) |
14 | 14 | expect_that(length(result[[1]]), equals(11)) |
15 | 15 | }) |
16 | 16 |
|
17 | | -test_that("data.frames with errors can be returned", { |
| 17 | +test_that("data.frames with errors can be returned from freegeoip", { |
18 | 18 | result <- freegeoip("Go ahead and try to hit me if you're able, can't you see that my relationship is stable") |
19 | 19 | expect_that(is.data.frame(result), equals(TRUE)) |
20 | 20 | expect_that(nrow(result), equals(1)) |
21 | 21 | expect_that(ncol(result), equals(11)) |
22 | 22 | expect_that(result$status[1], equals("Error")) |
23 | 23 | }) |
24 | 24 |
|
25 | | -test_that("Lists can be returned", { |
| 25 | +test_that("Lists can be returned from freegeoip", { |
26 | 26 | result <- freegeoip("I can see you hate the way we intermingle, but I think you're just mad cuz you're single", FALSE) |
27 | 27 | expect_that(is.list(result), equals(TRUE)) |
28 | 28 | expect_that(length(result), equals(1)) |
|
0 commit comments