diff --git a/tests/testthat.R b/tests/testthat.R index 972de0b..1b478c5 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -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") diff --git a/tests/testthat/tests-dataAccess.R b/tests/testthat/tests-data-access.R similarity index 100% rename from tests/testthat/tests-dataAccess.R rename to tests/testthat/tests-data-access.R diff --git a/tests/testthat/tests-nativeAPI.R b/tests/testthat/tests-native-api.R similarity index 100% rename from tests/testthat/tests-nativeAPI.R rename to tests/testthat/tests-native-api.R diff --git a/tests/testthat/tests-search.R b/tests/testthat/tests-search.R index 8eb360f..c4b446b 100644 --- a/tests/testthat/tests-search.R +++ b/tests/testthat/tests-search.R @@ -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"))) }) } diff --git a/tests/testthat/tests-sword.R b/tests/testthat/tests-sword.R index 171ddb1..fa716e0 100644 --- a/tests/testthat/tests-sword.R +++ b/tests/testthat/tests-sword.R @@ -1,5 +1,7 @@ context("SWORD API") +# use demo server: demo.dataverse.org + if (Sys.getenv("DATAVERSE_KEY") != "") { test_that("placeholder", { expect_true(TRUE)