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")
})

Try the restez package in your browser

Any scripts or data that you put into this service are public.

restez documentation built on Oct. 25, 2023, 5:06 p.m.