Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
juliasilge committed Sep 29, 2023
1 parent 913ea8c commit a13533b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions tests/testthat/_snaps/pin-read-write.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
Condition
Error in `pin_write()`:
! `name` must be a string
Code
pin_write(board, mtcars, name = 1:10, "json")
Condition
Error in `pin_write()`:
! The `type` argument must be named, like `type = "json"`.
Code
pin_write(board, mtcars, name = "mtcars", type = "froopy-loops")
Condition
Expand Down
3 changes: 2 additions & 1 deletion tests/testthat/test-pin-read-write.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ test_that("useful errors on bad inputs", {
expect_snapshot(error = TRUE, {
pin_write(mtcars)
pin_write(board, mtcars, name = 1:10)
pin_write(board, mtcars, name = 1:10, "json")
pin_write(board, mtcars, name = "mtcars", type = "froopy-loops")
pin_write(board, mtcars, name = "mtcars", metadata = 1)
})
Expand All @@ -65,7 +66,7 @@ test_that("pin_write() noisily generates name and type", {
test_that("user can supply metadata", {
board <- board_temp()

pin_write(board, 1:10, "x", metadata = list(name = "Susan"), desc = "A vector")
pin_write(board, 1:10, "x", metadata = list(name = "Susan"), description = "A vector")
meta <- pin_meta(board, "x")
expect_equal(meta$user, list(name = "Susan"))
expect_equal(meta$description, "A vector")
Expand Down

0 comments on commit a13533b

Please sign in to comment.