Skip to content

Commit

Permalink
skip most tests on cran
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Aug 19, 2019
1 parent 72cb51d commit 040ef9b
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tests/testthat/test-bibtex_reader.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
context("bibtex_reader")

test_that("bibtex_reader: works", {
skip_on_cran()

z <- system.file('extdata/crossref.bib', package = "handlr")
x <- bibtex_reader(z)

Expand Down
6 changes: 6 additions & 0 deletions tests/testthat/test-bibtex_writer.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
context("bibtex_writer")

test_that("bibtex_writer: works", {
skip_on_cran()

z <- system.file('extdata/citeproc.json', package = "handlr")
tmp <- citeproc_reader(z)
x <- bibtex_writer(z = tmp)
Expand All @@ -10,13 +12,17 @@ test_that("bibtex_writer: works", {
})

test_that("bibtex_writer: write from citeproc json", {
skip_on_cran()

z <- system.file('extdata/citeproc.json', package = "handlr")
tmp <- citeproc_reader(z)
x <- bibtex_writer(z = tmp)
expect_is(bibtex_reader(x), "handl")
})

test_that("bibtex_writer: output gives back same as input from bibtex_reader", {
skip_on_cran()

z <- system.file('extdata/bibtex2.bib', package = "handlr")
w <- bibtex_reader(z)
bw_out <- bibtex_writer(w)
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-citeproc_reader.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
context("citeproc_reader")

test_that("citeproc_reader: works", {
skip_on_cran()

z <- system.file('extdata/citeproc.json', package = "handlr")
x <- citeproc_reader(z)

Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-client.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
context("HandlrClient")

skip_on_cran()

test_that("HandlrClient class: after initializing, but before reading", {
expect_is(HandlrClient, "R6ClassGenerator")
expect_is(HandlrClient$new, "function")
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-client_guesses_format.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
context("HandlrClient: guesses format")

skip_on_cran()

test_that("guesses correctly: citeproc", {
z <- system.file("extdata/citeproc.json", package = "handlr")
x <- HandlrClient$new(z)
Expand Down
4 changes: 4 additions & 0 deletions tests/testthat/test-codemeta_reader.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ context("codemeta_reader")
z <- system.file('extdata/codemeta.json', package = "handlr")

test_that("codemeta_reader: works", {
skip_on_cran()

x <- codemeta_reader(z)

expect_is(codemeta_reader, "function")
Expand All @@ -16,6 +18,8 @@ test_that("codemeta_reader: works", {
})

test_that("codemeta_reader: read from string", {
skip_on_cran()

str <- paste0(readLines(z), collapse = "")
x <- codemeta_reader(str)

Expand Down
6 changes: 6 additions & 0 deletions tests/testthat/test-codemeta_writer.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
context("codemeta_writer")

test_that("codemeta_writer: works", {
skip_on_cran()

z <- system.file('extdata/codemeta.json', package = "handlr")
tmp <- codemeta_reader(z)
x <- codemeta_writer(tmp)
Expand All @@ -11,6 +13,8 @@ test_that("codemeta_writer: works", {
})

test_that("codemeta_writer: write from citeproc json", {
skip_on_cran()

z <- system.file('extdata/citeproc.json', package = "handlr")
tmp <- citeproc_reader(z)
x <- codemeta_writer(z = tmp)
Expand All @@ -20,6 +24,8 @@ test_that("codemeta_writer: write from citeproc json", {
test_that("codemeta_writer: output gives back same as
input from codemeta_reader", {

skip_on_cran()

z <- system.file('extdata/codemeta.json', package = "handlr")
w <- codemeta_reader(z)
bw_out <- codemeta_writer(w)
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-handl-class.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
context("handl-class")

test_that("handl class", {
skip_on_cran()

z <- system.file('extdata/crossref.bib', package = "handlr")
x <- bibtex_reader(z)

Expand Down
8 changes: 7 additions & 1 deletion tests/testthat/test-handl_to_df.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
context("handl_to_df")
# handl_to_df(handl_empty())

test_that("handl_to_df: works", {
skip_on_cran()

z <- system.file('extdata/crossref.bib', package = "handlr")
x <- bibtex_reader(z)
aa <- handl_to_df(x)
Expand All @@ -21,6 +23,8 @@ test_that("handl_to_df: works", {
})

test_that("handl_to_df: works with many citations", {
skip_on_cran()

z <- system.file('extdata/bib-many.bib', package = "handlr")
res2 <- bibtex_reader(x = z)
aa <- handl_to_df(res2)
Expand All @@ -33,6 +37,8 @@ test_that("handl_to_df: works with many citations", {
})

test_that("handl_to_df: works with HandlrClient", {
skip_on_cran()

z <- system.file('extdata/bib-many.bib', package = "handlr")
x <- HandlrClient$new(x = z)

Expand Down
4 changes: 4 additions & 0 deletions tests/testthat/test-ris_reader.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
context("ris_reader")

test_that("ris_reader: works", {
skip_on_cran()

z <- system.file("extdata/crossref.ris", package = "handlr")
x <- ris_reader(z)

Expand All @@ -25,6 +27,8 @@ test_that("ris_reader: works", {
})

test_that("ris_reader: many inputs", {
skip_on_cran()

z <- system.file("extdata/multiple-eg.ris", package = "handlr")
x <- ris_reader(z)

Expand Down
6 changes: 6 additions & 0 deletions tests/testthat/test-ris_writer.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
context("ris_writer")

test_that("ris_writer: works", {
skip_on_cran()

z <- system.file("extdata/crossref.ris", package = "handlr")
tmp <- ris_reader(z)
x <- ris_writer(tmp)
Expand All @@ -10,13 +12,17 @@ test_that("ris_writer: works", {
})

test_that("ris_writer: write from citeproc json", {
skip_on_cran()

z <- system.file("extdata/citeproc.json", package = "handlr")
tmp <- citeproc_reader(z)
x <- ris_writer(tmp)
expect_is(ris_reader(x), "handl")
})

test_that("ris_writer: output gives back same as input from ris_reader", {
skip_on_cran()

z <- system.file("extdata/peerj.ris", package = "handlr")
w <- ris_reader(z)
bw_out <- ris_writer(w)
Expand Down

0 comments on commit 040ef9b

Please sign in to comment.