-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed test in gbif_parse, output characters, not factors in the df
- Loading branch information
Showing
2 changed files
with
6 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
# tests for gbif_parse fxn in taxize | ||
context("gbif_parse") | ||
|
||
tt <- gbif_parse(scientificname='x Agropogon littoralis') | ||
tt <- gbif_parse(scientificname = 'x Agropogon littoralis') | ||
|
||
test_that("gbif_parse returns the correct value", { | ||
expect_that(as.character(tt[1,1]), matches('x Agropogon littoralis')) | ||
expect_that(as.character(tt[1,2]), matches('SCINAME')) | ||
expect_that(as.character(tt[1,2]), matches('SCIENTIFIC')) | ||
}) | ||
|
||
test_that("gbif_parse returns the correct dimensions", { | ||
expect_that(dim(tt), equals(c(1,9))) | ||
}) | ||
|
||
test_that("gbif_parse returns the correct class", { | ||
expect_that(tt, is_a("data.frame")) | ||
expect_that(tt$specificepithet, is_a("factor")) | ||
expect_that(tt$authorsparsed, is_a("logical")) | ||
expect_is(tt, "data.frame") | ||
expect_is(tt$specificepithet, "character") | ||
expect_is(tt$authorsparsed, "logical") | ||
}) |