Skip to content

Commit a9943da

Browse files
committed
Tweaks from running manual tests on Windows VM
1 parent 99e8ba1 commit a9943da

File tree

3 files changed

+22
-19
lines changed

3 files changed

+22
-19
lines changed

tests/manual/manual-create-from-github.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
devtools::load_all()
1+
#devtools::load_all()
2+
library(usethis)
23
library(testthat)
34
library(fs)
45

tests/manual/manual-use-course.R

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
devtools::load_all()
1+
library(usethis)
22
library(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 ----
2627
file_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
3132
expect_true(file_exists("rematch2-master.zip"))
3233

3334
## destdir = NULL, target filepath does exist ----
3435
expect_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")
4344
expect_true(file_exists("a"))
4445
file_delete("a/rematch2-master.zip")
4546
expect_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
4849
expect_true(file_exists("a/rematch2-master.zip"))
4950

5051
## destdir given & exists, target filepath does exist ----
5152
expect_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 ----
5859
expect_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
6566
dropbox1 <- "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)
6970
dropbox2 <- "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
7374
gh_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
7879
bitly <- "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
9091
tidy_unzip("~/tmp/manual/17-tidy-tools.zip")
@@ -93,10 +94,10 @@ tidy_unzip("rematch2-master.zip")
9394
tidy_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")
100101
file_move("yo-master", "yo")
101102
## git commit here
102103
file_delete("yo")

tests/manual/manual-use-github.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
devtools::load_all()
1+
#devtools::load_all()
2+
library(usethis)
23
library(fs)
34

45
pkgname <- "klmnop"

0 commit comments

Comments
 (0)