Skip to content

Commit 2a32022

Browse files
committed
fix: minor bugs
1 parent b7d1885 commit 2a32022

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

R/qenv-class.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ setClass(
2424
)
2525

2626
#' It initializes the `qenv` class
27-
#' @name qenv-class
28-
#' @keywords internal
27+
#' @noRd
2928
setMethod(
3029
"initialize",
3130
"qenv",
3231
function(.Object, .xData = new.env(parent = parent.env(.GlobalEnv)), ...) { # nolint: object_name.
32+
# .xData needs to be unnamed as the `.environment` constructure requires 1
33+
# unnamed formal argument. See methods::findMethods("initialize")$.environment
34+
.Object <- methods::callNextMethod(.Object, .xData, ...) # nolint: object_name.
35+
3336
checkmate::assert_environment(.xData)
3437
lockEnvironment(.xData, bindings = TRUE)
3538
.Object@.xData <- .xData # nolint: object_name.
3639

37-
# .xData needs to be unnamed as the `.environment` constructure requires 1
38-
# unnamed formal argument. See methods::findMethods("initialize")$.environment
39-
.Object <- methods::callNextMethod(.Object, .xData, ...) # nolint: object_name.
4040
.Object
4141
}
4242
)

man/qenv-class.Rd

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-qenv-class.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ testthat::describe("methods::new(qenv)", {
77
new_env <- new.env()
88
expect_false(environmentIsLocked(new_env))
99

10-
expect_true(environmentIsLocked(teal.code::get_env(methods::new("qenv"))))
10+
expect_true(environmentIsLocked(teal.code::get_env(methods::new("qenv", .xData = new_env))))
1111
})
1212

1313
testthat::it("throws error when id and code length doesn't match", {

tests/testthat/test-qenv_join.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ testthat::test_that("Joining two independent qenvs results in object having comb
1515
q2 <- eval_code(qenv(), quote(mtcars1 <- mtcars))
1616

1717
testthat::expect_true(.check_joinable(q1, q2))
18-
q <- join(q1, q2)
18+
q <- c(q1, q2)
1919

2020
testthat::expect_equal(q@.xData, list2env(list(iris1 = iris, mtcars1 = mtcars)))
2121
testthat::expect_identical(

0 commit comments

Comments
 (0)