Skip to content

Commit ba6c7bf

Browse files
author
ironholds
committed
amend tests to make failures more obvious via the command line (thanks to Kurt for demonstrating the issue)
1 parent 9381beb commit ba6c7bf

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

tests/testthat/test_freegeoip.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
context("Test freegeoip")
22

3-
test_that("data.frames can be returned", {
3+
test_that("data.frames can be returned from freegeoip", {
44
result <- freegeoip("2607:FB90:426:DC1D:CFC4:4875:8BC2:4D93")
55
expect_that(is.data.frame(result), equals(TRUE))
66
expect_that(nrow(result), equals(1))
77
expect_that(ncol(result), equals(11))
88
})
99

10-
test_that("Lists can be returned", {
10+
test_that("Lists can be returnedfrom freegeoip", {
1111
result <- freegeoip("2607:FB90:426:DC1D:CFC4:4875:8BC2:4D93", FALSE)
1212
expect_that(is.list(result), equals(TRUE))
1313
expect_that(length(result), equals(1))
1414
expect_that(length(result[[1]]), equals(11))
1515
})
1616

17-
test_that("data.frames with errors can be returned", {
17+
test_that("data.frames with errors can be returned from freegeoip", {
1818
result <- freegeoip("Go ahead and try to hit me if you're able, can't you see that my relationship is stable")
1919
expect_that(is.data.frame(result), equals(TRUE))
2020
expect_that(nrow(result), equals(1))
2121
expect_that(ncol(result), equals(11))
2222
expect_that(result$status[1], equals("Error"))
2323
})
2424

25-
test_that("Lists can be returned", {
25+
test_that("Lists can be returned from freegeoip", {
2626
result <- freegeoip("I can see you hate the way we intermingle, but I think you're just mad cuz you're single", FALSE)
2727
expect_that(is.list(result), equals(TRUE))
2828
expect_that(length(result), equals(1))

tests/testthat/test_ip_api.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
context("Test ip-api")
22

3-
test_that("data.frames can be returned", {
3+
test_that("data.frames can be returned from freegeoip", {
44
result <- ip_api("2607:FB90:426:DC1D:CFC4:4875:8BC2:4D93")
55
expect_that(is.data.frame(result), equals(TRUE))
66
expect_that(nrow(result), equals(1))
77
expect_that(ncol(result), equals(13))
88
})
99

10-
test_that("Lists can be returned", {
10+
test_that("Lists can be returned from freegeoip", {
1111
result <- ip_api("2607:FB90:426:DC1D:CFC4:4875:8BC2:4D93", FALSE)
1212
expect_that(is.list(result), equals(TRUE))
1313
expect_that(length(result), equals(1))
1414
expect_that(length(result[[1]]), equals(14))
1515
})
1616

17-
test_that("data.frames with errors can be returned", {
17+
test_that("data.frames with errors can be returned from freegeoip", {
1818
result <- ip_api("Go ahead and try to hit me if you're able, can't you see that my relationship is stable")
1919
expect_that(is.data.frame(result), equals(TRUE))
2020
expect_that(nrow(result), equals(1))
2121
expect_that(ncol(result), equals(13))
2222
expect_that(result$status[1], equals("Error"))
2323
})
2424

25-
test_that("Lists can be returned", {
25+
test_that("Lists can be returned from freegeoip", {
2626
result <- freegeoip("I can see you hate the way we intermingle, but I think you're just mad cuz you're single", FALSE)
2727
expect_that(is.list(result), equals(TRUE))
2828
expect_that(length(result), equals(1))

0 commit comments

Comments
 (0)