diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 2817a1e4..424c7d06 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -25,13 +25,14 @@ jobs: - {os: ubuntu-latest, r: 'oldrel-1'} env: - BOXR_PASSWORD: ${{ secrets.BOXR_PASSWORD }} - BOXR_USE_TOKEN: ${{ matrix.config.os == 'ubuntu-latest' && matrix.config.r == 'release' }} GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} R_KEEP_PKG_SOURCE: yes - + # these are the only local adaptations needed + BOXR_KEY: ${{ secrets.BOXR_KEY }} + BOXR_USE_TOKEN: ${{ matrix.config.os == 'ubuntu-latest' && matrix.config.r == 'release' }} + steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index ed7650c7..a7276e85 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -22,7 +22,7 @@ jobs: permissions: contents: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 @@ -41,7 +41,7 @@ jobs: - name: Deploy to GitHub pages 🚀 if: github.event_name != 'pull_request' - uses: JamesIves/github-pages-deploy-action@v4.4.1 + uses: JamesIves/github-pages-deploy-action@v4.5.0 with: clean: false branch: gh-pages diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 27d45283..960234cd 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -15,7 +15,7 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-r@v2 with: @@ -44,7 +44,7 @@ jobs: - name: Upload test results if: failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: coverage-test-failures path: ${{ runner.temp }}/package diff --git a/DESCRIPTION b/DESCRIPTION index 90c2485e..6718671f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: boxr Type: Package Title: Interface for the 'Box.com API' -Version: 0.3.6.9006 +Version: 0.3.6.9012 Authors@R: c( person("Brendan", "Rocks", email = "foss@brendanrocks.com", role = c("aut")), @@ -40,7 +40,6 @@ Imports: fs, glue, httr (>= 1.1.0), - httpuv, magrittr, mime, purrr, @@ -52,7 +51,8 @@ Imports: tibble, lifecycle, jsonlite, - jose + jose, + withr Suggests: clipr (>= 0.3.0), conflicted, diff --git a/NEWS.md b/NEWS.md index 62d13fce..95632699 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,9 +1,23 @@ # boxr 0.3.6 (development) +## Fixes + +* fix bug in `box_save()`, setting default environment for evaluating dots (#255) + ## Internal * update minimum version of rio package to reflect newer treatment of JSON files. (#261) +* remove unused internal function, removing dependency on httpuv package. (#259) + +* update superseded function-calls from gargle, used in testing. (#251) + +* default branch switched from `master` to `main`. (#252) + +* refactor to use withr functions to handle temp files. (#183) + +* activate tests for `box_save()`, `box_load()` (#255) + * update documentation to reflect updates to rio package. (#242, @chainsawriot) * update maintainer's email address. (#248) @@ -15,7 +29,7 @@ A patch is applied offering to move tokens from "old" locations. (#219 w/@danielruss) -* adds and updates GitHub Actions for testing and coverage. (#206, #247) +* adds and updates GitHub Actions for testing and coverage. (#206, #247, #256) # boxr 0.3.6 diff --git a/R/boxr__internal_misc.R b/R/boxr__internal_misc.R index c06e1e6c..19d563e4 100644 --- a/R/boxr__internal_misc.R +++ b/R/boxr__internal_misc.R @@ -294,7 +294,6 @@ create_test_dir <- function() { return() } - # A function to modify that directory structure modify_test_dir <- function() { # Delete a directory @@ -314,9 +313,8 @@ modify_test_dir <- function() { # A function to clear out a box.com directory clear_box_dir <- function(dir_id) { - dir.create("delete_me", showWarnings = FALSE) - box_push(dir_id, "delete_me", delete = TRUE) - unlink("delete_me", recursive = TRUE, force = TRUE) + tmp_dir <- withr::local_tempdir() + box_push(dir_id, tmp_dir, delete = TRUE) } @@ -355,17 +353,6 @@ modify_remote_dir <- function() }) - -#' @keywords internal -forRCMDCheck <- function(cran = "http://cran.r-project.org/") { - if (FALSE) { - httpuv::encodeURI(cran) - mime::guess_type(cran) - rio::import(cran) - } -} - - # API --------------------------------------------------------------------- #' Common Box API client-errors diff --git a/R/boxr_read.R b/R/boxr_read.R index 7d8a6c3e..b104d2a3 100644 --- a/R/boxr_read.R +++ b/R/boxr_read.R @@ -54,13 +54,13 @@ box_read <- function(file_id, type = NULL, version_id = NULL, ...) { checkAuth() - temp_file <- tempfile() + temp_file <- withr::local_tempfile() # Make the request req <- boxGet(file_id, local_file = temp_file, version_id = version_id, version_no = version_no, download = TRUE) - # Extract the filename + # Extract the filename and extension filename <- gsub( 'filename=\"|\"', '', stringr::str_extract( @@ -68,15 +68,15 @@ box_read <- function(file_id, type = NULL, version_id = NULL, 'filename=\"(.*?)\"' ) ) + file_ext <- glue::glue(".{fs::path_ext(filename)}") - # Give the file it's original name back, so that you can preserve the file - # extension - new_name <- paste0(tempdir(), "/", filename) - file.rename(temp_file, new_name) + # Give the file its original file-extension back + temp_file_new <- withr::local_tempfile(fileext = file_ext) + file.rename(temp_file, temp_file_new) # If the file doesn't have an obvious file extension, try and do the right # thing by considering the mime-type from the request - if (!grepl("\\.[[:alnum:]]+$", new_name)) { + if (!grepl("\\.[[:alnum:]]+$", temp_file_new)) { message("Cannot read file extension from name.\n", "Inferring from mime-type...\n") mime <- req$headers$`content-type` @@ -88,20 +88,17 @@ box_read <- function(file_id, type = NULL, version_id = NULL, # Supply the file format to read_fun, if it seems to accept them (the # default, rio::import, does) if ("format" %in% names(formals(read_fun))) { - cont <- read_fun(new_name, format = ext, ...) + cont <- read_fun(temp_file_new, format = ext, ...) } else { # Otherwise, just try and read it with a user-supplied function - cont <- read_fun(new_name, ...) + cont <- read_fun(temp_file_new, ...) } } else { - cont <- read_fun(new_name, ...) + cont <- read_fun(temp_file_new, ...) } - # Delete the tempfile - unlink(temp_file, force = TRUE) - message( - "Remote file '", new_name, "' read into memory as an object of class ", + "Remote file '", filename, "' read into memory as an object of class ", paste(class(cont), collapse = ", "), "\n" ) diff --git a/R/boxr_save_load.R b/R/boxr_save_load.R index 6884f3ec..114004eb 100644 --- a/R/boxr_save_load.R +++ b/R/boxr_save_load.R @@ -31,15 +31,10 @@ box_save <- function(..., dir_id = box_getwd(), file_name = ".RData", description = NULL) { - # TODO: fs - temp_file <- normalizePath(file.path(tempdir(), file_name), mustWork = FALSE) - - # clean up after ourselves - # TODO: withr 2.3.0 may have a cleaner way to do this: local_tempfile() - # - see https://github.com/r-lib/usethis/issues/1217 - on.exit(fs::file_delete(temp_file)) - - save(..., file = temp_file) + # using local_tempdir() to preserve the filename + temp_file <- fs::path(withr::local_tempdir(), file_name) + + save(..., envir = parent.frame(), file = temp_file) box_ul(dir_id, temp_file, description = description) } @@ -63,10 +58,9 @@ box_save_image <- function(dir_id = box_getwd(), file_name = ".RData", } } - # TODO: fs - temp_file <- normalizePath(file.path(tempdir(), file_name), mustWork = FALSE) - on.exit(fs::file_delete(temp_file)) - + # using local_tempdir() to preserve the filename + temp_file <- fs::path(withr::local_tempdir(), file_name) + save.image(file = temp_file) box_ul(dir_id, temp_file, description = description) @@ -76,9 +70,9 @@ box_save_image <- function(dir_id = box_getwd(), file_name = ".RData", #' @export #' box_load <- function(file_id) { - temp_dir <- tempdir() + # using local_tempdir() to preserve the filename + temp_dir <- withr::local_tempdir() temp_file <- box_dl(file_id, overwrite = TRUE, local_dir = temp_dir) - on.exit(fs::file_delete(temp_file)) load(temp_file, envir = globalenv()) } diff --git a/R/boxr_source.R b/R/boxr_source.R index 428f7342..1ac044c1 100644 --- a/R/boxr_source.R +++ b/R/boxr_source.R @@ -19,7 +19,7 @@ #' @export #' box_source <- function(file_id, local = globalenv(), ...) { - temp_dir <- tempdir() + temp_dir <- withr::local_tempdir() temp_file <- box_dl(file_id, overwrite = TRUE, local_dir = temp_dir) source(temp_file, local = local, ...) } diff --git a/R/boxr_upload_download.R b/R/boxr_upload_download.R index f9a7de7a..07a64a37 100644 --- a/R/boxr_upload_download.R +++ b/R/boxr_upload_download.R @@ -83,7 +83,7 @@ box_dl <- function(file_id, local_dir = getwd(), overwrite = FALSE, stop("File already exists locally, and overwrite = FALSE") # Get a temp file - temp_file <- tempfile() + temp_file <- withr::local_tempfile() # Download to a tempfile with boxGet req <- boxGet(file_id = file_id, version_id = version_id, @@ -127,9 +127,6 @@ box_dl <- function(file_id, local_dir = getwd(), overwrite = FALSE, stop("Problem writing file to ", new_file, ".\n Check that directory is writable.") - # Remove the tempfile to free up space - file.remove(temp_file) - return(new_file) } diff --git a/R/boxr_write.R b/R/boxr_write.R index 5b6006a6..b4d446f7 100644 --- a/R/boxr_write.R +++ b/R/boxr_write.R @@ -68,7 +68,9 @@ box_write <- function(object, file_name, dir_id = box_getwd(), description = NUL } } - temp_file <- paste0(tempdir(), "/", file_name) + # using local_tempdir() to preserve the filename + temp_file <- fs::path(withr::local_tempdir(), file_name) + write_fun(object, temp_file, ...) box_ul(dir_id = dir_id, file = temp_file, description = description) } diff --git a/README.Rmd b/README.Rmd index a3a14cf8..c558618f 100644 --- a/README.Rmd +++ b/README.Rmd @@ -19,7 +19,7 @@ url <- function(x = "") { [![cran version](https://www.r-pkg.org/badges/version/boxr)](https://CRAN.R-project.org/package=boxr) -[![codecov](https://codecov.io/gh/r-box/boxr/branch/master/graph/badge.svg?token=eeGrWfmg4P)](https://codecov.io/gh/r-box/boxr) +[![codecov](https://codecov.io/gh/r-box/boxr/branch/main/graph/badge.svg?token=eeGrWfmg4P)](https://codecov.io/gh/r-box/boxr) ![monthly_downloads](https://cranlogs.r-pkg.org/badges/boxr) [![R-CMD-check](https://github.com/r-box/boxr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-box/boxr/actions/workflows/R-CMD-check.yaml) diff --git a/README.md b/README.md index e1ea592a..43b73b52 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ [![cran version](https://www.r-pkg.org/badges/version/boxr)](https://CRAN.R-project.org/package=boxr) -[![R-CMD-check](https://github.com/r-box/boxr/workflows/R-CMD-check/badge.svg)](https://github.com/r-box/boxr/actions) -[![codecov](https://codecov.io/gh/r-box/boxr/branch/master/graph/badge.svg?token=eeGrWfmg4P)](https://codecov.io/gh/r-box/boxr) +[![codecov](https://codecov.io/gh/r-box/boxr/branch/main/graph/badge.svg?token=eeGrWfmg4P)](https://codecov.io/gh/r-box/boxr) ![monthly_downloads](https://cranlogs.r-pkg.org/badges/boxr) +[![R-CMD-check](https://github.com/r-box/boxr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-box/boxr/actions/workflows/R-CMD-check.yaml) A lightweight, *opinionated*, high-level R interface to the box.com API, @@ -23,9 +23,9 @@ easier for you to integrate your Box account into your R workflow. ### Bug fixes -- Harmonizes the default location for tokens; `~` resolves to the home - directory for all platforms. A patch is applied offering to move - tokens from “old” locations. This bug appeared on Windows only. +- Harmonizes the default location for tokens; `~` resolves to the home + directory for all platforms. A patch is applied offering to move + tokens from “old” locations. This bug appeared on Windows only. All changes are detailed in the [NEWS](https://r-box.github.io/boxr/news/). @@ -52,8 +52,8 @@ The package-documentation website is created and maintained using [pkgdown](https://pkgdown.r-lib.org). The documentation website consists of: -- a [CRAN-version site](https://r-box.github.io/boxr/). -- a [development-version site](https://r-box.github.io/boxr/dev/). +- a [CRAN-version site](https://r-box.github.io/boxr/). +- a [development-version site](https://r-box.github.io/boxr/dev/). ## Usage @@ -88,44 +88,43 @@ Box-app](https://r-box.github.io/boxr/articles/boxr-app-interactive.html) ### Basic operations -- [Accessing Box - files](https://r-box.github.io/boxr/articles/boxr.html#files): - `box_ul()`, `box_dl()`, `box_version_history()`. -- [Accessing Box - directories](https://r-box.github.io/boxr/articles/boxr.html#directories): - `box_setwd()`, `box_getwd()`, `box_dir_create()`, `box_ls()`, - `box_search()`. -- [Directory-wide - operations](https://r-box.github.io/boxr/articles/boxr.html#directory-wide-operations): - `box_push()`, `box_fetch()`. +- [Accessing Box + files](https://r-box.github.io/boxr/articles/boxr.html#files): + `box_ul()`, `box_dl()`, `box_version_history()`. +- [Accessing Box + directories](https://r-box.github.io/boxr/articles/boxr.html#directories): + `box_setwd()`, `box_getwd()`, `box_dir_create()`, `box_ls()`, + `box_search()`. +- [Directory-wide + operations](https://r-box.github.io/boxr/articles/boxr.html#directory-wide-operations): + `box_push()`, `box_fetch()`. ### Advanced operations -- [Interactng with Box - files](https://r-box.github.io/boxr/articles/boxr.html#box-file-interaction): - `box_collab_create()`, `box_comment_create()`, - `box_add_description()`. -- [Using Box - trash](https://r-box.github.io/boxr/articles/boxr.html#using-box-trash): - `box_delete_file()`, `box_delete_folder()`, `box_restore_file()`, - `box_restore_folder()`. -- [Interacting with your R - session](https://r-box.github.io/boxr/articles/boxr.html#interacting-with-your-r-session): - `box_read()`, `box_write()`, `box_read_rds()`, `box_save_rds()`, - `box_save()`, `box_load()`, `box_browse()`. +- [Interactng with Box + files](https://r-box.github.io/boxr/articles/boxr.html#box-file-interaction): + `box_collab_create()`, `box_comment_create()`, + `box_add_description()`. +- [Using Box + trash](https://r-box.github.io/boxr/articles/boxr.html#using-box-trash): + `box_delete_file()`, `box_delete_folder()`, `box_restore_file()`, + `box_restore_folder()`. +- [Interacting with your R + session](https://r-box.github.io/boxr/articles/boxr.html#interacting-with-your-r-session): + `box_read()`, `box_write()`, `box_read_rds()`, `box_save_rds()`, + `box_save()`, `box_load()`, `box_browse()`. ## Alternatives Other ways to interact with a Box account include: -- The [Box desktop apps](https://www.box.com/resources/downloads). -- The *other* boxr, [written in - Ruby](https://github.com/cburnette/boxr). Its motivations are rather - different, and it covers 100% of the box.com API (e.g account - administration, etc.). -- Box themselves provide a [wide range of - SDKs](https://github.com/box), including [one for - Python](https://github.com/box/box-python-sdk). +- The [Box desktop apps](https://www.box.com/resources/downloads). +- The *other* boxr, [written in + Ruby](https://github.com/cburnette/boxr). Its motivations are rather + different, and it covers 100% of the box.com API (e.g account + administration, etc.). +- Box themselves provide a [wide range of SDKs](https://github.com/box), + including [one for Python](https://github.com/box/box-python-sdk). ## Contributing @@ -139,7 +138,7 @@ Conduct](https://r-box.github.io/boxr/CONDUCT.html). The MIT License (MIT) -Copyright (c) 2015-2022 boxr contributors +Copyright (c) 2015-2024 boxr contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/inst/secret/boxr-testing.json b/inst/secret/boxr-testing.json index b3e88e83..fcf17f82 100644 Binary files a/inst/secret/boxr-testing.json and b/inst/secret/boxr-testing.json differ diff --git a/tests/testthat/setup_auth.R b/tests/testthat/setup_auth.R index 6639c072..c31b7f41 100644 --- a/tests/testthat/setup_auth.R +++ b/tests/testthat/setup_auth.R @@ -8,9 +8,26 @@ # use_token <- identical(Sys.getenv("BOXR_USE_TOKEN"), "true") -if (use_token && gargle:::secret_can_decrypt("boxr")) { - raw <- gargle:::secret_read("boxr", "boxr-testing.json") - text <- rawToChar(raw) +path_secret <- system.file("secret", "boxr-testing.json", package = "boxr") +env_secret <- "BOXR_KEY" + +# NOTE 2024-01-07: +# - the key used with the deprecated gargle functions had 50 characters +# - the new gargle functions can accept a key max 32 characters +# - if you have an old "BOXR_PASSWORD", truncate it to use the first 32 chars + +if (gargle::secret_has_key("BOXR_PASSWORD")) { + # TODO: replace with cli::cli_alert_warning() + warning( + paste( + "You are using an obselete credential `BOXR_PASSWORD`.", + "Truncate to use the first 32 characters, and rename as `BOXR_KEY`." + ) + ) +} + +if (use_token && gargle::secret_has_key(env_secret)) { + text <- gargle::secret_decrypt_json(path_secret, env_secret) box_auth_service(token_text = text) } diff --git a/tests/testthat/test_01_oauth.R b/tests/testthat/test_01_oauth.R index fb40e3c8..eeb8c21c 100644 --- a/tests/testthat/test_01_oauth.R +++ b/tests/testthat/test_01_oauth.R @@ -10,14 +10,17 @@ context("OAuth2.0 via JWT") # these two tests are useful for debugging gargle and its relation to the Travis CI environment # they are not relevant to boxr beyond that +# path_secret <- system.file("secret", "boxr-testing.json", package = "boxr") +# env_secret <- "BOXR_KEY" +# # test_that("gargle can find secret", { -# expect_true(gargle:::secret_can_decrypt("boxr")) +# expect_true(gargle::secret_has_key(env_secret)) # }) # # test_that("gargle can read secret", { -# json <- gargle:::secret_read("boxr", "boxr-testing.json") -# expect_type(json, "raw") -# expect_true(length(json) > 50) +# text <- gargle::secret_decrypt_json(path_secret, env_secret) +# expect_true(inherits("x", "character")) +# expect_true(nchar(text) > 50) # }) diff --git a/tests/testthat/test_02_clear_out.R b/tests/testthat/test_02_clear_out.R index 7b389ff7..42e7c0a1 100644 --- a/tests/testthat/test_02_clear_out.R +++ b/tests/testthat/test_02_clear_out.R @@ -20,7 +20,7 @@ test_that("Clear out the remote directory", { options(boxr.verbose = FALSE) # Tell boxr to sync the remote home directory with an empty local one # (i.e. delete everything) - b <- box_push(0, fs::path_temp("test_dir/dir_12/dir_121/dir_1211"), delete = TRUE) + boxr:::clear_box_dir(0) expect_length(box_ls(0), 0) diff --git a/tests/testthat/test_04_load_save.R b/tests/testthat/test_04_load_save.R index d90dd10f..729adcea 100644 --- a/tests/testthat/test_04_load_save.R +++ b/tests/testthat/test_04_load_save.R @@ -1,44 +1,27 @@ -# Load/Save --------------------------------------------------------------- -# For some reason (probably related to environements), these run fine in the -# console/terminal, but testthat can't find the files when running them with -# devtools::test() -# -# Leaving not-run, for now -if (FALSE) { - context("Load/Save") - - test_that("Saving R Object Remotely", { - skip_on_cran() - skip_if_no_token() - - # Here's an R object - test_list <- list(data.frame(), 1:10, letters) - test_vars$test_list <- test_list - rda_name <- "test.RData" - - # The upload should throw an error if it doesn't work - b <- box_save(test_list, envir = globalenv(), dir_id = 0, file_name = rda_name) - - # Put the id in an environment variable for subsequent tests - test_vars$object_return <- b - - # Did the file end up with the right name? - expect_equal(rda_name, b$entries[[1]]$name) - }) - - test_that("Loading remote R object", { - skip_on_cran() - skip_if_no_token() - - rm("object") - - # Can you load the remote file which stores the R object? - b <- box_load(test_vars$object_return$entries[[1]]$id) - - # Did it return the right object name? - expect_equal("object", b) - # Is the R object the same after it's journey? - expect_equal(object, test_vars$object) - }) - -} +context("Load/Save") + +test_that("object can be saved, retrieved, and deleted", { + skip_on_cran() + skip_if_no_token() + + # Here's an R object + test_ref <- list(data.frame(), 1:10, letters) + + test_list <- test_ref + rda_name <- "test.RData" + + b_save <- box_save(test_list, dir_id = 0, file_name = rda_name) + expect_equal(rda_name, b_save$name) + + rm("test_list") + + # will load data into `test_list` + b_load <- box_load(b_save$id) + expect_identical(b_load, "test_list") + expect_equal(test_ref, test_list) + + # clean up + box_delete_file(b_save$id) + +}) + diff --git a/tests/testthat/test_05_read_write.R b/tests/testthat/test_05_read_write.R index 92d8068c..44be226f 100644 --- a/tests/testthat/test_05_read_write.R +++ b/tests/testthat/test_05_read_write.R @@ -8,7 +8,7 @@ test_that("You can source a remote R script", { skip_if_no_token() # Write a little R script - tf <- paste(tempfile(), ".R") + tf <- withr::local_tempfile(fileext = ".R") writeLines("test_vector <- 1:10\n", tf) # Upload it, so that you can 'source it' back down @@ -26,7 +26,7 @@ test_that("You can write/read a remote .csv file", { skip_if_no_token() # Write a little .csv file - tf <- paste0(tempfile(), ".csv") + tf <- withr::local_tempfile(fileext = ".csv") # Note: It looks like although httr says it uses read.csv for the .csv files, # it doesn't obey the usual R behaviour of treating strings as factors by # default. So to get two objects that match, you'll need to make sure they're @@ -58,7 +58,7 @@ test_that("You can write/read a remote .tsv file", { skip_if_no_token() # Write a little .tsv file - tf <- paste0(tempfile(), ".tsv") + tf <- withr::local_tempfile(fileext = ".tsv") df <- data.frame(a = letters[1:5], b = 1:5, c = rnorm(5), stringsAsFactors = FALSE) @@ -88,7 +88,7 @@ test_that("You can write/read a remote .json file", { skip_if_no_token() # Write a little .json file - tf <- paste0(tempfile(), ".json") + tf <- withr::local_tempfile(fileext = ".json") df <- data.frame(a = letters[1:5], b = 1:5, c = rnorm(5), stringsAsFactors = FALSE) l <- list(a = 1:10, b = matrix(1, 3, 3), c = df) diff --git a/tests/testthat/test_99_tidy_up.R b/tests/testthat/test_99_tidy_up.R index 620ebdb3..7b0d6d7f 100644 --- a/tests/testthat/test_99_tidy_up.R +++ b/tests/testthat/test_99_tidy_up.R @@ -5,8 +5,7 @@ test_that("Box directory is emptied", { boxr:::skip_on_travis() skip_if_no_token() - # push empty local dir to top level on Box - b <- box_push(0, fs::path_temp("test_dir/dir_12/dir_121/dir_1211"), delete = TRUE) + boxr:::clear_box_dir(0) expect_equal(nrow(as.data.frame(box_ls(0))), 0) })