Error in `list.files(".", pattern = pattern, full.names = TRUE)`: invalid 'pattern' regular expression

writeLines("hi", con = file.path(test_path, "cat.R"))
# can allow duplicated names via the allowed_duplicates param

Error in `turn_off()`: You must eject all cassettes before you can turn vcr off.

test_that("turned_off works iif no cassettes active", {
expect_snapshot(turned_off(5 + 5), error = TRUE)
beetle <- crul::HttpClient$new(url = hb("/get"))$get()
test_that("inserting a cassette errors when vcr turned off and ignore_cassettes=FALSE", {
# after being turned off, insert_cassette throws an error
test_that("default options set as expected", {
list(on = TRUE, ignore_cassettes = FALSE)
test_that("lightswitch_init() respects env vars", {
withr::local_envvar(VCR_TURNED_OFF = TRUE, VCR_IGNORE_CASSETTES = FALSE)
list(on = FALSE, ignore_cassettes = FALSE)
list(on = FALSE, ignore_cassettes = TRUE)
test_that("lightswitch env var handles varying inputs", {

"turned_off works iif no cassettes active"
"inserting a cassette errors when vcr turned off and ignore_cassettes=FALSE"
"lightswitch env var handles varying inputs"

inserting a cassette errors when vcr turned off and ignore_cassettes=FALSE

Error in `local_cassette(name, dir = dir, record = record, match_requests_on = match_requests_on, 
    serialize_with = serialize_with, preserve_exact_body_bytes = preserve_exact_body_bytes, 
    re_record_interval = re_record_interval, warn_on_empty = warn_on_empty)`: `name` must not be the same as an existing cassette.

test_that("can generate all three types of response", {
test_that("can capture & replay raw body", {
test_that("can send an image raw body in request - w/ appropriate header", {
img <- system.file(package = 'httr2', 'help/figures/logo.png')
bin <- readBin(img, what = 'raw', n = file.size(img))
request <- httr2::req_headers(request, 'Content-Type' = 'image/png')
test_that("can send an image raw body in request - w/o appropriate header", {
request <- httr2::req_error(request, is_error = function(resp) FALSE)
test_that("httr2 redacts auth header", {
request <- httr2::req_auth_basic(request, "foo", "bar")
local_vcr_configure(dir = withr::local_tempdir(), match_requests_on = "body")
test_that("binary body uses base64 encoding", {
req <- httr2::req_headers(req, "Accept" = "image/png")
req <- httr2::req_body_json(req, list(foo = "bar"))
req <- httr2::req_body_form(req, a = "x", b = "y")
expect_equal(httr2::resp_body_json(resp_record)$form, list(a = "x", b = "y"))
test_that("can capture body: multipart", {
req <- httr2::req_body_multipart(req, a = "x", b = "y")
expect_equal(vcr_last_request()$body, list(fields = list(a = "x", b = "y")))
path <- withr::local_tempfile(fileext = ".txt", lines = "hello world")
test_that("redacted headers handled appropriately", {