createBiodbTestInstance: Creating a BiodbMain instance for tests.

View source: R/test_framework.R

createBiodbTestInstanceR Documentation

Creating a BiodbMain instance for tests.

Description

Creates a BiodbMain instance with options specially adapted for tests. You can request the logging of all messages into a log file. It is also possible to ask for the creation of a BiodbTestMsgAck observer, which will receive all messages and emit a testthat test for each message. This will allow the testthat output to not stall a long time while, for example, downloading or extracting a database. Do not forget to call terminate() on your instance at the end of your tests.

Usage

createBiodbTestInstance(ack = FALSE)

Arguments

ack

If set to TRUE, an instance of BiodbTestMsgAck will be attached to the BiodbMain instance.

Value

The created BiodbMain instance.

Examples

# Instantiate a BiodbMain instance for testing
biodb <- biodb::createBiodbTestInstance()

# Terminate the instance
biodb$terminate()


pkrog/biodb documentation built on Nov. 29, 2022, 4:24 a.m.