copy_fixture: Copy fixtures to make available for tests

View source: R/dev_helpers.R

copy_fixtureR Documentation

Copy fixtures to make available for tests

Description

A wrapper to around dput to copy a database fixture from origin to a directory with fixtures used by dittodb.

Usage

copy_fixture(
  mock_db = "./tests/testthat/mock_db/",
  origin,
  filename,
  verbose = FALSE
)

Arguments

mock_db

The path to the mock database containing the fixtures for dittodb. Default is ⁠tests/testthat/mock_db/⁠.

origin

The origin directory where dittodb saved the fixtures from capturing

filename

The name of the file to be copied.

verbose

Logical. Should filenames be printed? The filename consist of the first SQL verb of the query (often "SELECT") and the hash of the query that is sent. See the dittodb documentation for details.

Value

Copies the fixture from ⁠mock_db/origin/⁠ to ⁠mock_db/⁠.


f-hafner/magutils documentation built on Sept. 20, 2023, 5:05 a.m.