Skip to content

Commit 6a5d149

Browse files
committed
fix descriptions in few more tests
1 parent 084382a commit 6a5d149

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tests/testthat/test-qenv_eval_code.R

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ testthat::test_that("an error when calling eval_code returns a qenv.error object
9191
testthat::expect_equal(q$message, "object 'w' not found \n when evaluating qenv code:\nexpression(z <- w * x)")
9292
})
9393

94-
testthat::test_that("a warning when calling eval_code returns a qenv object which has warnings", {
94+
testthat::test_that(
95+
"a warning when calling eval_code returns a qenv object which has warnings as attributes of code", {
9596
q <- eval_code(qenv(), quote("iris_data <- iris"))
9697
q <- eval_code(q, quote("p <- hist(iris_data[, 'Sepal.Length'], ff = '')"))
9798
testthat::expect_s4_class(q, "qenv")
@@ -101,7 +102,8 @@ testthat::test_that("a warning when calling eval_code returns a qenv object whic
101102
)
102103
})
103104

104-
testthat::test_that("eval_code with a vector of code produces one warning element per code element", {
105+
testthat::test_that(
106+
"eval_code associates warnings with call by adding attribute to code element", {
105107
q <- eval_code(qenv(), c("x <- 1", "y <- 1", "warning('warn1')"))
106108
testthat::expect_equal(
107109
lapply(q@code, attr, "warning"),
@@ -110,7 +112,8 @@ testthat::test_that("eval_code with a vector of code produces one warning elemen
110112
})
111113

112114

113-
testthat::test_that("a message when calling eval_code returns a qenv object which has messages", {
115+
testthat::test_that(
116+
"eval_code associates messages with call by adding attribute to code element", {
114117
q <- eval_code(qenv(), quote("iris_data <- head(iris)"))
115118
q <- eval_code(q, quote("message('This is a message')"))
116119
testthat::expect_s4_class(q, "qenv")
@@ -123,7 +126,8 @@ testthat::test_that("a message when calling eval_code returns a qenv object whic
123126
)
124127
})
125128

126-
testthat::test_that("eval_code returns a qenv object with empty messages and warnings when none are returned", {
129+
testthat::test_that(
130+
"eval_code returns a qenv object with empty messages and warnings as code attributes, when none are returned", {
127131
q <- eval_code(qenv(), quote("iris_data <- head(iris)"))
128132
testthat::expect_s4_class(q, "qenv")
129133
testthat::expect_null(attr(q@code, "message"))

0 commit comments

Comments
 (0)