tests/testthat/test-biomartr-tools.R

# LIBS
library(testthat)
library(mockery)

# RUNNING
test_that('check_connection() works', {
  stub(check_connection, "url_exists", TRUE)
  expect_true(check_connection())
  stub(check_connection, "url_exists", FALSE)
  expect_error(
    check_connection(),
    "Unable to connect to")
})
ropensci/restez documentation built on April 21, 2024, 2:40 p.m.