Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make local_temp_app() usage more consistent #844

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

hadley
Copy link
Member

@hadley hadley commented May 8, 2023

And make it a little easier to use with ...

@hadley hadley requested a review from aronatkins May 8, 2023 22:48
@@ -146,23 +149,23 @@ test_that("ignores python virtual envs", {
# explodeFiles ------------------------------------------------------------

test_that("returns relative paths", {
dir <- withr::local_tempdir()
dir <- local_temp_app()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you expect that this will become:

dir <- local_temp_app(
  "x/a" = "",
  "x/b" = "",
  "x/c" = "'
)

local_temp_app would need to change to dir.create(dirname(files)), but that's in reach, if you want it.

The challenge would be the cases where you want to create empty directories as part of the test set-up. Maybe:

dir <- local_temp_app(
    "packrat/" = ""
)

None of this is must-take. Just musing on ways to simply describe "create this set of files / directories" without requiring every test to have its own creation code.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I had contemplated that too. If you were thinking the same thing, I think it's a sign that it's worth doing.

#Conflicts:
#	tests/testthat/test-applications.R
#	tests/testthat/test-bundleFiles.R
#	tests/testthat/test-deployApp.R
#	tests/testthat/test-deploymentTarget.R
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants