check_cassette_names {vcr}R Documentation

Check cassette names

Description

Check cassette names

Usage

check_cassette_names(
  pattern = "test-",
  behavior = "stop",
  allowed_duplicates = NULL
)

Arguments

pattern

(character) regex pattern for file paths to check. this is done inside of ⁠tests/testthat/⁠. default: "test-"

behavior

(character) "stop" (default) or "warning". if "warning", we use immediate.=TRUE so the warning happens at the top of your tests rather than you seeing it after tests have run (as would happen by default)

allowed_duplicates

(character) cassette names that can be duplicated

Details

Cassette names:

vcr::check_cassette_names() is meant to be run during your tests, from a ⁠helper-*.R⁠ file inside the tests/testthat directory. It only checks that cassette names are not duplicated. Note that if you do need to have duplicated cassette names you can do so by using the allowed_duplicates parameter in check_cassette_names(). A helper function check_cassette_names() runs inside insert_cassette() that checks that cassettes do not have: spaces, file extensions, unaccepted characters (slashes).


[Package vcr version 1.6.0 Index]