resourceDirectory function

Directory resourceDirectory(
  1. {String path = '',
  2. String prefix = _defaultPrefix}
)

Retrieves a test resource Directory.

"Test resources" are files stored (by default) under the test/resources/ directory of the project root. This prefix may be changed, using the prefix argument.

Arguments

  • String path - the relative path (from the prefix by default). An empty string will provide the prefixed root directory.
  • String prefix - the path prefix from the project root (defaults to test/resources).

Return

A Directory reference to the specified resource.

Example

Directory resourceDir = resourceDirectory('data/dir');

Implementation

Directory resourceDirectory({
  String path = '',
  String prefix = _defaultPrefix,
}) =>
    Directory('${_resourceRoot(prefix)}$path');