tests/testthat/test-connectionDetails.R

library(testthat)

test_that("Open and close connection", {
  connectionDetails <- createConnectionDetails(
    dbms = "postgresql",
    user = aNonExistingvariable
  )
  expect_error(
    connect(connectionDetails),
    regexp = "Unable to evaluate the 'user' argument"
  )
})

Try the DatabaseConnector package in your browser

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

DatabaseConnector documentation built on May 29, 2024, 6:14 a.m.