From 0665afebd08d5fe807ccde80a058125b0143d001 Mon Sep 17 00:00:00 2001 From: Will Beasley Date: Sun, 14 Jan 2024 13:21:24 -0600 Subject: [PATCH] don't test functions that need a live connection close #135 --- R/assert-version.R | 4 +-- .../test-assert-version-driver-sqlserver.R | 27 ------------------- 2 files changed, 2 insertions(+), 29 deletions(-) delete mode 100644 tests/testthat/test-assert-version-driver-sqlserver.R diff --git a/R/assert-version.R b/R/assert-version.R index 8f000ad..8f6f6ae 100644 --- a/R/assert-version.R +++ b/R/assert-version.R @@ -154,7 +154,7 @@ assert_version_package <- function( assert_version_driver_sqlserver <- function( connection, minimum -) { +) { # nocov start checkmate::assert_class(connection, "Microsoft SQL Server") checkmate::assert_vector(minimum, len = 1, any.missing = FALSE) @@ -189,4 +189,4 @@ assert_version_driver_sqlserver <- function( } else { invisible(TRUE) } -} +} # nocov end diff --git a/tests/testthat/test-assert-version-driver-sqlserver.R b/tests/testthat/test-assert-version-driver-sqlserver.R deleted file mode 100644 index 24e0a99..0000000 --- a/tests/testthat/test-assert-version-driver-sqlserver.R +++ /dev/null @@ -1,27 +0,0 @@ -library(testthat) - -test_that("old minimum", { - r <- assert_version_r("3.1.0") - expect_true(r) - - assert_version_r(package_version("3.1.0")) - expect_true(r) -}) - -test_that("default minimum", { - r <- assert_version_r() - expect_true(r) -}) - -test_that("minimum that throws an error", { - expected_error_message <- "Your R version is too old" - expect_error( - assert_version_r("99.1.0"), - expected_error_message - ) - - expect_error( - assert_version_r(package_version("99.1.0")), - expected_error_message - ) -})