Skip to content

Commit

Permalink
Fix warnings resulting from deprecated testthat functions
Browse files Browse the repository at this point in the history
  • Loading branch information
sebpardo committed Mar 10, 2017
1 parent 80c5f23 commit 92a4319
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/testthat/test-ebirdgeo.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ test_that("ebirdgeo works correctly", {
expect_is(egeo$howMany, "integer")
expect_is(ebirdgeo(lat = 42, lng = -76, max=10, provisional=TRUE, hotspot=TRUE), "data.frame")
expect_equal(nrow(ebirdgeo(lat = 42, lng = -76, max=10, provisional=TRUE, hotspot=TRUE)), 10)
expect_that(ebirdgeo(lat = 40, lng = -120, dist = 50), not(gives_warning()))
expect_silent(ebirdgeo(lat = 40, lng = -120, dist = 50))
expect_warning(ebirdgeo(lat = 30, lng = -120, dist = 100), "Distance supplied was >50km")
})
2 changes: 1 addition & 1 deletion tests/testthat/test-ebirdhotspot.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test_that("ebirdhotspot works correctly", {
out <- ebirdhotspot('L99381', max=10, provisional=TRUE)
expect_is(out, "data.frame")
expect_is(out$comName, "character")
expect_that(ebirdhotspot('L99381'), not(gives_warning()))
expect_silent(ebirdhotspot('L99381'))

expect_warning(ebirdhotspot(locID = 'L99381', back = 40))
})
8 changes: 4 additions & 4 deletions tests/testthat/test-ebirdloc.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ test_that("ebirdloc works correctly", {

simpler <- ebirdloc('L99381', max = 1, simple = TRUE)
lesssimpler <- ebirdloc('L99381', max = 1, simple = FALSE)
expect_less_than(NCOL(simpler), 15)
expect_that(NCOL(simpler), not(is_less_than(8)))
expect_less_than(NCOL(lesssimpler), 30)
expect_that(NCOL(lesssimpler), not(is_less_than(10)))
expect_lt(NCOL(simpler), 15)
expect_gt(NCOL(simpler), 8)
expect_lt(NCOL(lesssimpler), 30)
expect_gt(NCOL(lesssimpler), 10)
})


Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-ebirdnotable.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ test_that("ebirdnotable works correctly", {
expect_equal(dim(simpler), c(40,11))
# expect_equal(dim(lesssimpler), c(40,24))

expect_more_than(
expect_gt(
system.time(ebirdnotable(lat=42, lng=-70, max = 10, sleep = 1))[[3]]
, 1)
})

0 comments on commit 92a4319

Please sign in to comment.