Skip to content

Commit

Permalink
Mock rsconnect::writeManifest() in test (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
juliasilge authored Aug 9, 2023
1 parent 09a6c5b commit 779931a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/rsconnect.R
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,7 @@ vetiver_create_rsconnect_bundle <- function(
invisible(filename)

}

mock_write_manifest <- function(appDir, appFiles) {
fs::file_create(fs::path(appDir, "manifest.json"))
}
1 change: 1 addition & 0 deletions tests/testthat/test-rsconnect.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
skip_if_not_installed("rsconnect")

describe("create rsconnect bundle", {
local_mocked_bindings(writeManifest = mock_write_manifest, .package = "rsconnect")
tar_file <- fs::file_temp(pattern = "bundle", tmp_dir = tmp_dir, ext = ".tar.gz")

b <- board_folder(path = tmp_dir)
Expand Down

0 comments on commit 779931a

Please sign in to comment.