diff --git a/R/DEPRECATED-read.mat.Witec.R b/R/DEPRECATED-read.mat.Witec.R index 7eec132e..7402e589 100644 --- a/R/DEPRECATED-read.mat.Witec.R +++ b/R/DEPRECATED-read.mat.Witec.R @@ -52,13 +52,13 @@ read.mat.Witec <- function(file = stop("filename or connection needed")) { } hySpc.testthat::test(read.mat.Witec) <- function() { - context("read.mat.Witec") - test_that( - "deprecated", + test_that("deprecated", { + local_edition(3) + expect_warning( expect_error(read.mat.Witec(file = ""), "Can only read a MAT file"), "deprecated|supports" ) - ) + }) } diff --git a/R/DEPRECATED-read.spc.R b/R/DEPRECATED-read.spc.R index 68bd6665..472cc748 100644 --- a/R/DEPRECATED-read.spc.R +++ b/R/DEPRECATED-read.spc.R @@ -850,15 +850,15 @@ read.spc <- function(filename, hySpc.testthat::test(read.spc) <- function() { - context("read.spc") - test_that( - "deprecated", - expect_warning( - expect_error(read.spc(file = ""), "can only read"), - "deprecated" - ) - ) + test_that("deprecated", { + local_edition(3) + + expect_warning(expect_warning( + expect_error(read.spc(file = ""), "can only read"), + "deprecated" + )) + }) } diff --git a/R/DEPRECATED-read.spe.R b/R/DEPRECATED-read.spe.R index 20ca1d0f..04b26d60 100644 --- a/R/DEPRECATED-read.spe.R +++ b/R/DEPRECATED-read.spe.R @@ -358,11 +358,13 @@ spe.showcalpoints <- function(filename, xaxis = "file", acc2avg = F, cts_sec = F ############# UNIT TESTS ################ hySpc.testthat::test(read.spe) <- function() { - test_that( - "deprecated", - expect_warning( + + test_that("deprecated", { + local_edition(3) + + expect_warning(expect_warning( expect_error(read.spe(filename = ""), "can only read"), "deprecated" - ) - ) + )) + }) } diff --git a/R/DEPRECATED-read.txt.Renishaw.R b/R/DEPRECATED-read.txt.Renishaw.R index 3746e004..f21645ce 100644 --- a/R/DEPRECATED-read.txt.Renishaw.R +++ b/R/DEPRECATED-read.txt.Renishaw.R @@ -167,15 +167,15 @@ read.txt.Renishaw <- function(file = stop("file is required"), } hySpc.testthat::test(read.txt.Renishaw) <- function() { - context("read.txt.Renishaw") - test_that( - "deprecated", - expect_warning( + test_that("deprecated", { + local_edition(3) + + expect_warning(expect_warning( expect_error(read.txt.Renishaw(file = ""), "cannot open"), "deprecated" - ) - ) + )) + }) } #' @rdname DEPRECATED-read.txt.Renishaw @@ -194,13 +194,13 @@ read.zip.Renishaw <- function(file = stop("filename is required"), } hySpc.testthat::test(read.zip.Renishaw) <- function() { - context("read.zip.Renishaw") - test_that( - "deprecated", - expect_warning( + test_that("deprecated", { + local_edition(3) + + expect_warning(expect_warning(expect_warning( expect_error(read.zip.Renishaw(file = ""), "cannot open"), "deprecated" - ) - ) + ))) + }) } diff --git a/R/DEPRECATED-read.txt.Shimadzu.R b/R/DEPRECATED-read.txt.Shimadzu.R index 7559f405..aa6b66c0 100644 --- a/R/DEPRECATED-read.txt.Shimadzu.R +++ b/R/DEPRECATED-read.txt.Shimadzu.R @@ -227,13 +227,13 @@ read.txt.Shimadzu <- function(filename, encoding = "", quiet = TRUE) { } hySpc.testthat::test(read.txt.Shimadzu) <- function() { - context("read.txt.Shimadzu") - test_that( - "deprecated", - expect_warning( + test_that("deprecated", { + local_edition(3) + + expect_warning(expect_warning( expect_error(read.txt.Shimadzu(file = ""), "attempt to select"), "deprecated" - ) - ) + )) + }) } diff --git a/R/plot.R b/R/plot.R index 6bc2134a..8c99b761 100644 --- a/R/plot.R +++ b/R/plot.R @@ -188,6 +188,7 @@ hySpc.testthat::test(.plot) <- function() { # vdiffr::manage_cases(package = "./hyperSpec") test_that("warnings and errors in plot()", { + local_edition(3) # Data ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ expect_silent(hy_spectra <- generate_hy_spectra())