List cassettes, get current cassette, etc.
Details
cassettes()
: returns cassettes found in your R session, you can toggle whether we pull from those on disk or notcurrent_cassette()
: returns an empty list when no cassettes are in use, while it returns the current cassette (aCassette
object) when one is in usecassette_path()
: just gives you the current directory path where cassettes will be stored
Examples
vcr_configure(dir = tempdir())
#> <vcr configuration>
#> Cassette Dir: /tmp/RtmplV3bmA
#> Record: once
#> Serialize with: yaml
#> URI Parser: crul::url_parse
#> Match Requests on: method, uri
#> Preserve Bytes?: FALSE
#> Logging?: FALSE
#> ignored hosts:
#> ignore localhost?: FALSE
#> Write disk path:
# list all cassettes
cassettes()
#> list()
cassettes(on_disk = FALSE)
#> list()
# list the currently active cassette
insert_cassette("stuffthings")
#> <vcr - Cassette> stuffthings
#> Record method: once
#> Serialize with: yaml
#> Persist with: FileSystem
#> Re-record interval (s):
#> Clean outdated interactions?: FALSE
#> update_content_length_header: FALSE
#> allow_playback_repeats: FALSE
#> allow_unused_http_interactions:
#> exclusive:
#> preserve_exact_body_bytes: FALSE
current_cassette()
#> <vcr - Cassette> stuffthings
#> Record method: once
#> Serialize with: yaml
#> Persist with: FileSystem
#> Re-record interval (s):
#> Clean outdated interactions?: FALSE
#> update_content_length_header: FALSE
#> allow_playback_repeats: FALSE
#> allow_unused_http_interactions:
#> exclusive:
#> preserve_exact_body_bytes: FALSE
eject_cassette()
#> Warning: Empty cassette (stuffthings) deleted; consider the following:
#> - If an error occurred resolve that first, then check:
#> - vcr only supports crul, httr & httr2; requests w/ curl, download.file, etc. are not supported
#> - If you are using crul/httr/httr2, are you sure you made an HTTP request?
#> net connect disabled
#> <vcr - Cassette> stuffthings
#> Record method: once
#> Serialize with: yaml
#> Persist with: FileSystem
#> Re-record interval (s):
#> Clean outdated interactions?: FALSE
#> update_content_length_header: FALSE
#> allow_playback_repeats: FALSE
#> allow_unused_http_interactions:
#> exclusive:
#> preserve_exact_body_bytes: FALSE
cassettes()
#> list()
cassettes(on_disk = FALSE)
#> list()
# list the path to cassettes
cassette_path()
#> [1] "/tmp/RtmplV3bmA"
vcr_configure(dir = file.path(tempdir(), "foo"))
#> <vcr configuration>
#> Cassette Dir: /tmp/RtmplV3bmA/foo
#> Record: once
#> Serialize with: yaml
#> URI Parser: crul::url_parse
#> Match Requests on: method, uri
#> Preserve Bytes?: FALSE
#> Logging?: FALSE
#> ignored hosts:
#> ignore localhost?: FALSE
#> Write disk path:
cassette_path()
#> [1] "/tmp/RtmplV3bmA/foo"
vcr_configure_reset()