Learn R Programming

httptest (version 3.0.0)

change_state: Handle a change of server state

Description

Changes to server state can be handled by setting a new .mockPaths(). In vignettes, these are handled by creating subdirectories with integer names. This function increments that integer subdirectory and adds it to .mockPaths() so that changed server state can be captured and loaded.

Usage

change_state()

Arguments

Value

Invisibly, the return of .mockPaths() with the new path added.

Details

In a vignette, put a call to change_state() before any code block that makes a change on the server, or rather, before any code block that might repeat the same request previously done and expect a different result.