storr (version 1.0.0)

test_driver: Test a storr driver

Description

Test that a driver passes all storr tests. This page is only of interest to people developing storr drivers; nothing here is required for using storr.

Usage

test_driver(create)

Arguments

create
A function with no arguments that when run will create a new driver instance. Depending on your storage model, temporary directories, in-memory locations, or random-but-unique prefixes may help create isolated locations for the test (the tests assume tha

Details

This will run through a suite of functions to test that a driver is likely to behave itself. As bugs are found they will be added to the test suite to guard against regressions.

The test suite is included in the package as system.file("spec", package="storr").

The procedure for each test block is:

  1. Create a new driver by runningdr <- create().
Run a number of tests. Destroy the driver by running dr$destroy().

Examples

Run this code
## Testing the environment driver is nice and fast:
if (requireNamespace("testthat")) {
  test_driver(function() driver_environment())
}

# To test things like the rds driver, I would run:
if (requireNamespace("testthat")) {
  test_driver(function() driver_rds(tempfile()))
}

Run the code above in your browser using DataCamp Workspace