From a13533b20072a816ae0755e27e4c7627c776f25d Mon Sep 17 00:00:00 2001 From: Julia Silge Date: Fri, 29 Sep 2023 11:38:42 -0600 Subject: [PATCH] Update tests --- tests/testthat/_snaps/pin-read-write.md | 5 +++++ tests/testthat/test-pin-read-write.R | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/testthat/_snaps/pin-read-write.md b/tests/testthat/_snaps/pin-read-write.md index fad76a59..2d3ea0df 100644 --- a/tests/testthat/_snaps/pin-read-write.md +++ b/tests/testthat/_snaps/pin-read-write.md @@ -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 diff --git a/tests/testthat/test-pin-read-write.R b/tests/testthat/test-pin-read-write.R index 593532d5..8fbdc311 100644 --- a/tests/testthat/test-pin-read-write.R +++ b/tests/testthat/test-pin-read-write.R @@ -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) }) @@ -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")