tests/testthat/test-post-studies.R

context("test-post-studies")

test_that("open_in_pubmed: exceptions", {
  expect_error(open_in_pubmed(pubmed_id = FALSE), "pubmed_id must be a vector of numbers.")
  expect_error(open_in_pubmed(pubmed_id = -123), "These are not valid PubMed IDs: -123.")
})

test_that("open_in_pubmed: typical usage", {
  with_mock(
    `browseURL` = function(...) TRUE,
    {
      expect_true(open_in_pubmed(pubmed_id = 123))
      expect_true(open_in_pubmed(pubmed_id = 123L))
      expect_true(open_in_pubmed(pubmed_id = '123'))
    }
  )
})

Try the gwasrapidd package in your browser

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

gwasrapidd documentation built on Dec. 28, 2022, 2:16 a.m.