Skip to content

Commit

Permalink
Skip network tests on CRAN
Browse files Browse the repository at this point in the history
  • Loading branch information
jimhester committed Jul 18, 2019
1 parent ea1f43e commit f57f51c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# available 1.0.4

* Tests requiring network access are not skipped on CRAN.

# available 1.0.3

* `BiocManager` is now preferred to `BiocInstaller` if both are installed (#44, @luciorq).
Expand Down
4 changes: 4 additions & 0 deletions tests/testthat/test-badwords.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
context("Check package name for bad words")

test_that("Catches bad word", {
skip_on_cran()

expect_identical("hell", get_bad_words("hell")[[1L]])
})

test_that("Passes safe word", {
skip_on_cran()

expect_true(length(get_bad_words("happy")) == 0)
})
5 changes: 4 additions & 1 deletion tests/testthat/test-bioc.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
context("Load packages from Bioconductor")

test_that("Can find dplyr", {
skip_on_cran()

expect_false(available_on_bioc("ACME"))
})

test_that("Can't find made up package", {
skip_on_cran()

expect_true(available_on_bioc("This_is_not_a_pkg"))
})

4 changes: 4 additions & 0 deletions tests/testthat/test-cran.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
context("Load packages from CRAN")

test_that("Can find dplyr", {
skip_on_cran()

expect_false(available_on_cran("dplyr"))
})

test_that("Can't find made up package", {
skip_on_cran()

expect_true(available_on_cran("This_is_not_a_pkg"))
})

4 changes: 4 additions & 0 deletions tests/testthat/test-github.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
context("Load packages from GitHub")

test_that("Can find ", {
skip_on_cran()

expect_false(available_on_github("svrepmisc")$available)
})

test_that("Can't find made up package", {
skip_on_cran()

expect_true(available_on_github("This_is_not_a_pkg")$available)
})

0 comments on commit f57f51c

Please sign in to comment.