1- devtools :: load_all( )
1+ library( usethis )
22library(fs )
3+ library(testthat )
34
45# # Inspiration for manual tests. Pretty rough.
56
@@ -24,15 +25,15 @@ owd <- setwd(path_temp())
2425
2526# # destdir = NULL, pedantic = TRUE, target filepath doesn't exist ----
2627file_delete(" rematch2-master.zip" )
27- download_zip(gh_url , pedantic = TRUE )
28+ usethis ::: download_zip(gh_url , pedantic = TRUE )
2829# # should get "Proceed...?" prompt
2930# # no --> aborts
3031# # yes --> downloads
3132expect_true(file_exists(" rematch2-master.zip" ))
3233
3334# # destdir = NULL, target filepath does exist ----
3435expect_true(file_exists(" rematch2-master.zip" ))
35- download_zip(gh_url )
36+ usethis ::: download_zip(gh_url )
3637# # should get "Overwrite...?" query
3738# # no --> aborts
3839# # yes --> downloads
@@ -43,48 +44,48 @@ dir_create("a")
4344expect_true(file_exists(" a" ))
4445file_delete(" a/rematch2-master.zip" )
4546expect_false(file_exists(" a/rematch2-master.zip" ))
46- download_zip(gh_url , destdir = " a" )
47+ usethis ::: download_zip(gh_url , destdir = " a" )
4748# # should just download
4849expect_true(file_exists(" a/rematch2-master.zip" ))
4950
5051# # destdir given & exists, target filepath does exist ----
5152expect_true(file_exists(" a/rematch2-master.zip" ))
52- download_zip(gh_url , destdir = " a" )
53+ usethis ::: download_zip(gh_url , destdir = " a" )
5354# # should get "Overwrite...?" query
5455# # no --> aborts
5556# # yes --> downloads
5657
5758# # destdir given & does not exist ----
5859expect_false(file_exists(" b" ))
59- download_zip(gh_url , destdir = " b" )
60+ usethis ::: download_zip(gh_url , destdir = " b" )
6061# # should get error re: Directory does not exist
6162
6263# # Download from various places ----
6364
6465# # usethis-test folder JB created for development
6566dropbox1 <- " https://www.dropbox.com/sh/0pedgdob30bbbei/AACYL0JyZD6XcpZk_-YmtpgXa?dl=1"
66- download_zip(dropbox1 , pedantic = FALSE )
67+ usethis ::: download_zip(dropbox1 , pedantic = FALSE )
6768
6869# # an actual workshop folder from Hadley (big and slow)
6970dropbox2 <- " https://www.dropbox.com/sh/ofc1gifr77ofej8/AACuBrToN1Yjo_ZxWfrYnEbJa?dl=1"
70- download_zip(dropbox2 , pedantic = FALSE )
71+ usethis ::: download_zip(dropbox2 , pedantic = FALSE )
7172
7273# # the ZIP URL favored by devtools
7374gh_url <- " http://github.com/r-lib/rematch2/zipball/master/"
74- download_zip(gh_url , pedantic = FALSE )
75+ usethis ::: download_zip(gh_url , pedantic = FALSE )
7576
7677# # don't be surprised if asked whether to Overwrite, this may have been
7778# # downloaded before, via other means
7879bitly <- " http://bit.ly/uusseetthhiiss"
79- download_zip(bitly , pedantic = FALSE )
80+ usethis ::: download_zip(bitly , pedantic = FALSE )
8081
8182# tidy_unzip() ----
8283
8384# # if they are in wd
84- tidy_unzip(" 17-tidy-tools.zip" )
85- tidy_unzip(" r-lib-rematch2-335a55f.zip" )
86- tidy_unzip(" rematch2-master.zip" )
87- tidy_unzip(" usethis-test.zip" )
85+ usethis ::: tidy_unzip(" 17-tidy-tools.zip" )
86+ usethis ::: tidy_unzip(" r-lib-rematch2-335a55f.zip" )
87+ usethis ::: tidy_unzip(" rematch2-master.zip" )
88+ usethis ::: tidy_unzip(" usethis-test.zip" )
8889
8990# # if they are in ~/tmp
9091tidy_unzip(" ~/tmp/manual/17-tidy-tools.zip" )
@@ -93,10 +94,10 @@ tidy_unzip("rematch2-master.zip")
9394tidy_unzip(" ~/tmp/manual/usethis-test.zip" )
9495
9596# one-off test of GitHub vs DropBox
96- download_zip(" https://github.com/jennybc/yo/archive/master.zip" , pedantic = FALSE )
97- download_zip(" https://www.dropbox.com/sh/afydxe6pkpz8v6m/AADHbMZAaW3IQ8zppH9mjNsga?dl=1" , pedantic = FALSE )
97+ usethis ::: download_zip(" https://github.com/jennybc/yo/archive/master.zip" , pedantic = FALSE )
98+ usethis ::: download_zip(" https://www.dropbox.com/sh/afydxe6pkpz8v6m/AADHbMZAaW3IQ8zppH9mjNsga?dl=1" , pedantic = FALSE )
9899
99- tidy_unzip(" yo-master.zip" )
100+ usethis ::: tidy_unzip(" yo-master.zip" )
100101file_move(" yo-master" , " yo" )
101102# # git commit here
102103file_delete(" yo" )
0 commit comments