Skip to content

Commit

Permalink
a test environment set up that seems to work
Browse files Browse the repository at this point in the history
  • Loading branch information
radbasa committed Aug 9, 2024
1 parent 3f7a585 commit fcefd6f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/testthat/helper-utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,15 @@ expect_equivalent <- function(x, y) {
language_client <- function(working_dir = getwd(), diagnostics = FALSE, capabilities = NULL) {
withr::local_dir(working_dir)
withr::local_file(".Rprofile", {
parser_code <- c(
"box_use_parser <-",
deparse(box_use_parser)
)
write(parser_code, ".Rprofile", append = TRUE)

rprofile <- readLines(fs::path_package("box.lsp", "Rprofile.R"))
writeLines(rprofile, ".Rprofile")
rprofile <- sub("box.lsp::", "", rprofile)
write(rprofile, ".Rprofile", append = TRUE)
readLines(".Rprofile")
})

Expand Down

0 comments on commit fcefd6f

Please sign in to comment.