Learn R Programming

vcr (version 1.6.0)

cassettes: List cassettes, get current cassette, etc.

Description

List cassettes, get current cassette, etc.

Usage

cassettes(on_disk = TRUE, verb = FALSE)

current_cassette()

cassette_path()

Arguments

on_disk

(logical) Check for cassettes on disk + cassettes in session (TRUE), or check for only cassettes in session (FALSE). Default: TRUE

verb

(logical) verbose messages

Details

  • cassettes(): returns cassettes found in your R session, you can toggle whether we pull from those on disk or not

  • current_cassette(): returns an empty list when no cassettes are in use, while it returns the current cassette (a Cassette object) when one is in use

  • cassette_path(): just gives you the current directory path where cassettes will be stored

Examples

Run this code
vcr_configure(dir = tempdir())

# list all cassettes
cassettes()
cassettes(on_disk = FALSE)

# list the currently active cassette
insert_cassette("stuffthings")
current_cassette()
eject_cassette()

cassettes()
cassettes(on_disk = FALSE)

# list the path to cassettes
cassette_path()
vcr_configure(dir = file.path(tempdir(), "foo"))
cassette_path()

vcr_configure_reset()

Run the code above in your browser using DataLab