Skip to contents

Reads the resource with read_resource(), and expects its text to match regexp. A resource that cannot be read, an unknown URI or a function that fails, is an error.

Usage

expect_resource(uri, regexp = NULL, ...)

Arguments

uri

URI of the resource.

regexp

Regular expression the text of the resource must match, or NULL.

...

Passed to read_resource().

Value

The result of resources/read, invisibly.

Examples

if (FALSE) { # \dontrun{
# In the tests of a package made by create_mordew():
expect_resource(
  "runlog://surfaces",
  "trail"
)
} # }