Skip to content
8 changes: 4 additions & 4 deletions R/DEPRECATED-read.mat.Witec.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
)
})
}
16 changes: 8 additions & 8 deletions R/DEPRECATED-read.spc.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"
))
})
}


Expand Down
12 changes: 7 additions & 5 deletions R/DEPRECATED-read.spe.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
)
))
})
}
24 changes: 12 additions & 12 deletions R/DEPRECATED-read.txt.Renishaw.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
)
)
)))
})
}
12 changes: 6 additions & 6 deletions R/DEPRECATED-read.txt.Shimadzu.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
)
))
})
}
1 change: 1 addition & 0 deletions R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down