usethis
usethis copied to clipboard
Fix Issue #1961: tidy unzip directory
Fix for issue #1961 to allow use_zip to successfully unzip file with different directory structure
Can you create a small .zip file that displays the behaviour you're targetting? And add it as a test fixture, similar to yo-loose-regular.zip and the like, all explained here https://github.com/r-lib/usethis/tree/main/tests/testthat/ref.
Then you can add a new test for your scenario, along these lines:
https://github.com/r-lib/usethis/blob/fdb4a7244df3a229dbf2b9af1027e8b962b8a59a/tests/testthat/test-course.R#L86-L107
You can put that in a new test, i.e. a new test_that() block inside test-course.R.
Test fixture added. I was not able to find the test_file function, but the test works for me if I change that command to point to the test file in the testthat/ref folder, the test script runs smoothly.
@jennybc Sorry for the delay, it took me a while to get back to this! I have resolved typo on previous request and updated test to be compatible with current main branch.