-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* bump version * fix stray NULL-return * return invisible(NULL) on delete-functions * roxygenize * add tests * rename test-file, add token-skip * add NEWS item Co-authored-by: Nathan (Nate) Day <[email protected]>
- Loading branch information
1 parent
6422009
commit ded836b
Showing
7 changed files
with
55 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Package: boxr | ||
Type: Package | ||
Title: Interface for the 'Box.com API' | ||
Version: 0.3.5.9014 | ||
Version: 0.3.5.9015 | ||
Authors@R: c( | ||
person("Brendan", "Rocks", email = "[email protected]", | ||
role = c("aut")), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
test_that("box_folder_delete() works", { | ||
|
||
skip_if_no_token() | ||
|
||
name_dir <- "test-folder-delete" | ||
|
||
folder <- box_dir_create(name_dir, parent_dir_id = 0) | ||
|
||
# check that box_delete_folder returns invisible(NULL) | ||
expect_invisible( | ||
expect_null( | ||
box_delete_folder(folder$id) | ||
) | ||
) | ||
|
||
# check that name_dir is not in box directory | ||
names <- box_ls(0) %>% as.data.frame() %>% `[[`("name") | ||
expect_false(name_dir %in% names) | ||
|
||
}) | ||
|
||
|
||
test_that("box_file_delete() works", { | ||
|
||
skip_if_no_token() | ||
|
||
name_file <- "test-file-delete.rds" | ||
|
||
file_upload <- box_save_rds("test", file_name = name_file, dir_id = 0) | ||
|
||
# check that box_delete_file returns invisible(NULL) | ||
expect_invisible( | ||
expect_null( | ||
box_delete_file(file_upload$id) | ||
) | ||
) | ||
|
||
# check that name_file is not in box directory | ||
names <- box_ls(0) %>% as.data.frame() %>% `[[`("name") | ||
expect_false(name_file %in% names) | ||
|
||
}) |