-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to desired working directory BEFORE callr::r()
- Loading branch information
Showing
2 changed files
with
36 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
test_that(".Rprofile local to reprex target directory is consulted", { | ||
local_temp_wd("reprextests-aaa") | ||
cat("x <- 'aaa'\n", file = ".Rprofile") | ||
cat("x\n", file = "foo.R") | ||
aaa_foo <- path_abs("foo.R") | ||
|
||
local_temp_wd("reprextests-bbb") | ||
cat("x <- 'bbb'\n", file = ".Rprofile") | ||
|
||
out <- reprex(x, outfile = NA, advertise = FALSE) | ||
expect_match(out, "bbb", all = FALSE) | ||
|
||
out <- reprex(input = aaa_foo, outfile = NA, advertise = FALSE) | ||
expect_match(out, "aaa", all = FALSE) | ||
}) |