Check cassette names
check_cassette_names( pattern = "test-", behavior = "stop", allowed_duplicates = NULL )
(character) regex pattern for file paths to check.
this is done inside of
(character) "stop" (default) or "warning". if "warning",
(character) cassette names that can be duplicated
Should be meaningful so that it is obvious to you what test/function they relate to. Meaningful names are important so that you can quickly determine to what test file or test block a cassette belongs. Note that vcr cannot check that your cassette names are meaningful.
Should not be duplicated. Duplicated cassette names would lead to a test using the wrong cassette.
Should not have spaces. Spaces can lead to problems in using file paths.
Should not include a file extension. vcr handles file extensions for the user.
Should not have control characters, e.g.,
Should not have just dots, e.g.,
Should not have Windows reserved words, e.g.,
Should not have trailing dots
Should not be longer than 255 characters
vcr::check_cassette_names() is meant to be run during your tests, from
setup-pkgname.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
check_cassette_names() runs inside
insert_cassette() that checks that cassettes
do not have: spaces, file extensions, unaccepted characters (slashes)