-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref #4
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# See https://demo.dataverse.org/dataverse/dataverse-client-r | ||
|
||
test_that("dataverse root", { | ||
actual <- get_dataverse( | ||
dataverse = ":root" | ||
) | ||
expect_equal(actual$id, 1L) | ||
expect_equal(actual$alias, "demo") | ||
expect_equal(actual$name, "Demo Dataverse") | ||
expect_s3_class(actual$dataverseContacts, "data.frame") | ||
expect_match(actual$description, "^.+This Dataverse is for demo purposes only\\..+$") | ||
expect_equal(actual$creationDate, "2015-04-16T17:46:00Z") # Notice this is a string | ||
}) | ||
|
||
test_that("dataverse for 'dataverse-client-r'", { | ||
actual <- get_dataverse( | ||
dataverse = "dataverse-client-r" | ||
) | ||
expect_equal(actual$id, 396355) | ||
expect_equal(actual$alias, "dataverse-client-r") | ||
expect_equal(actual$name, "dataverse-client-r") | ||
expect_equal(actual$affiliation, "IQSS") | ||
expect_s3_class(actual$dataverseContacts, "data.frame") | ||
expect_match(actual$description, "^Dataverse for testing.+$") | ||
expect_equal(actual$creationDate, "2020-01-02T04:18:06Z") # Notice this is a string | ||
}) |