dragosmg commented on a change in pull request #12486:
URL: https://github.com/apache/arrow/pull/12486#discussion_r813361796
##########
File path: r/tests/testthat/test-duckdb.R
##########
@@ -15,11 +15,25 @@
# specific language governing permissions and limitations
# under the License.
-skip_if_not_installed("duckdb", minimum_version = "0.3.1")
-skip_if_not_installed("dbplyr")
skip_if_not_available("dataset")
skip_on_cran()
+# this test needs to be the first one since all other test blocks are skipped
+# if duckdb is not installed
+test_that("meaningful error message when duckdb is not installed", {
+ # skipping if duckdb is installed since we're testing the to_duckdb
function's
+ # complaint when a user tries to call it, but duckdb isn't available
+ skip_if(requireNamespace("duckdb", quietly = TRUE))
+ ds <- InMemoryDataset$create(example_data)
+ expect_snapshot(
+ to_duckdb(ds),
+ error = TRUE
+ )
Review comment:
Done. Switched to `expect_error()`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]