Skip to content

Commit

Permalink
start working on test suite (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
leeper committed Jun 12, 2017
1 parent 9352800 commit 9125975
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
9 changes: 2 additions & 7 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
library("testthat")
local({
library("dataverse")
dv_server <- Sys.getenv("DATAVERSE_SERVER")
on.exit(Sys.setenv("DATAVERSE_SERVER" = dv_server))
Sys.setenv("DATAVERSE_SERVER" = "dataverse.harvard.edu")
#test_check("dataverse")
})
library("dataverse")
test_check("dataverse")
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions tests/testthat/tests-search.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ context("Search API")
if (Sys.getenv("DATAVERSE_KEY") != "") {

test_that("simple search query", {
expect_true(is.data.frame(dataverse_search("Gary King")))
expect_true(is.data.frame(dataverse_search("Gary King", server = "dataverse.harvard.edu")))
})

test_that("named argument search", {
expect_true(is.data.frame(dataverse_search(author = "Gary King", title = "Ecological Inference")))
expect_true(is.data.frame(dataverse_search(author = "Gary King", title = "Ecological Inference", server = "dataverse.harvard.edu")))
})

test_that("simple search w/type argument", {
expect_true(is.data.frame(dataverse_search(author = "Gary King", type = "dataset")))
expect_true(is.data.frame(dataverse_search(author = "Gary King", type = "dataset", server = "dataverse.harvard.edu")))
})

}
2 changes: 2 additions & 0 deletions tests/testthat/tests-sword.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
context("SWORD API")

# use demo server: demo.dataverse.org

if (Sys.getenv("DATAVERSE_KEY") != "") {
test_that("placeholder", {
expect_true(TRUE)
Expand Down

0 comments on commit 9125975

Please sign in to comment.