usethis icon indicating copy to clipboard operation
usethis copied to clipboard

Fix Issue #1961: tidy unzip directory

Open burnsal opened this issue 1 year ago • 3 comments

Fix for issue #1961 to allow use_zip to successfully unzip file with different directory structure

burnsal avatar Mar 08 '24 22:03 burnsal

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.

jennybc avatar Mar 08 '24 22:03 jennybc

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.

burnsal avatar Mar 12 '24 15:03 burnsal

@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.

burnsal avatar Mar 26 '24 17:03 burnsal