Package: vcr 1.6.0

Scott Chamberlain

vcr: Record 'HTTP' Calls to Disk

Record test suite 'HTTP' requests and replays them during future runs. A port of the Ruby gem of the same name (<https://github.com/vcr/vcr/>). Works by hooking into the 'webmockr' R package for matching 'HTTP' requests by various rules ('HTTP' method, 'URL', query parameters, headers, body, etc.), and then caching real 'HTTP' responses on disk in 'cassettes'. Subsequent 'HTTP' requests matching any previous requests in the same 'cassette' use a cached 'HTTP' response.

Authors:Scott Chamberlain [aut, cre], Aaron Wolen [aut], Maëlle Salmon [aut], Daniel Possenriede [aut], rOpenSci [fnd]

vcr_1.6.0.tar.gz
vcr_1.6.0.tar.gz(r-4.5-noble)vcr_1.6.0.tar.gz(r-4.4-noble)
vcr_1.6.0.tgz(r-4.4-emscripten)vcr_1.6.0.tgz(r-4.3-emscripten)
vcr.pdf |vcr.html
vcr/json (API)
NEWS

# Install 'vcr' in R:
install.packages('vcr', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/ropensci/vcr/issues

Datasets:
  • crul_request - An HTTP request as prepared by the 'crul' package

httphttpsapiweb-servicescurlmockmockinghttp-mockingtestingtesting-toolstdd

4.69 score 161 scripts 3.1k downloads 41 exports 28 dependencies

Last updated 3 months agofrom:e71d9adcfa. Checks:OK: 2. Indexed: no.

TargetResultDate
Doc / VignettesOKSep 22 2024
R-4.5-linuxOKSep 22 2024

Exports:as.cassetteas.cassettepathCassettecassette_pathcassettescheck_cassette_namescurrent_cassetteeject_cassettehttp_interactionsHTTPInteractionHTTPInteractionListinsert_cassettePersistersreal_http_connections_allowedRequestrequest_summaryRequestHandlerRequestHandlerCrulRequestHandlerHttrRequestHandlerHttr2RequestMatcherRegistryresponse_summaryserializer_fetchSerializersskip_if_vcr_offturn_offturn_onturned_offturned_onUnhandledHTTPRequestErroruse_cassetteuse_vcrvcr_config_defaultsvcr_configurationvcr_configurevcr_configure_resetvcr_last_errorvcr_log_filevcr_log_infovcr_test_pathVcrResponse

Dependencies:askpassbase64encclicrulcurlfauxpasgluehttpcodehttrhttr2jsonlitelifecyclemagrittrmimeopensslR6rappdirsRcpprlangrprojrootsystriebeardurltoolsvctrswebmockrwhiskerwithryaml

Introduction to vcr

Rendered fromvcr.Rmdusingknitr::rmarkdownon Sep 22 2024.

Last update: 2024-07-24
Started: 2019-08-20

Configure vcr

Rendered fromconfiguration.Rmdusingknitr::rmarkdownon Sep 22 2024.

Last update: 2020-12-12
Started: 2018-05-14

Configure vcr request matching

Rendered fromrequest_matching.Rmdusingknitr::rmarkdownon Sep 22 2024.

Last update: 2020-12-12
Started: 2018-05-14

Debugging your tests that use vcr

Rendered fromdebugging.Rmdusingknitr::rmarkdownon Sep 22 2024.

Last update: 2020-12-12
Started: 2020-12-12

Why and how to edit your vcr cassettes?

Rendered fromcassette-manual-editing.Rmdusingknitr::rmarkdownon Sep 22 2024.

Last update: 2020-12-12
Started: 2020-12-12

Design of vcr

Rendered fromdesign.Rmdusingknitr::rmarkdownon Sep 22 2024.

Last update: 2021-05-22
Started: 2021-05-22

How vcr works, in a lot of details

Rendered frominternals.Rmdusingknitr::rmarkdownon Sep 22 2024.

Last update: 2020-12-12
Started: 2020-12-12

Turning vcr on and off

Rendered fromlightswitch.Rmdusingknitr::rmarkdownon Sep 22 2024.

Last update: 2021-05-22
Started: 2021-05-22

Record modes

Rendered fromrecord-modes.Rmdusingknitr::rmarkdownon Sep 22 2024.

Last update: 2021-05-22
Started: 2021-05-22

Mocking writing to disk

Rendered fromwrite-to-disk.Rmdusingknitr::rmarkdownon Sep 22 2024.

Last update: 2021-05-22
Started: 2021-05-22

Readme and manuals

Help Manual

Help pageTopics
Coerce names, etc. to cassettesas.cassette as.cassettepath
List cassettes, get current cassette, etc.cassettes cassette_path current_cassette
Check cassette namescheck_cassette_names
An HTTP request as prepared by the 'crul' packagecrul_request
Eject a cassetteeject_cassette
Get the http interactions of the current cassettehttp_interactions
HTTPInteraction classHTTPInteraction
HTTPInteractionList classHTTPInteractionList
Insert a cassette to record HTTP requestsinsert_cassette
Turn vcr on and off, check on/off status, and turn off for a given http calllightswitch turned_off turned_on turn_off turn_on
Are real http connections allowed?real_http_connections_allowed
vcr recording optionsrecording
vcr request matchingrequest-matching
RequestHandlerRequestHandler
RequestHandlerCrulRequestHandlerCrul
RequestHandlerHttrRequestHandlerHttr
RequestHandlerHttr2RequestHandlerHttr2
RequestMatcherRegistryRequestMatcherRegistry
Skip tests if vcr is offskip_if_vcr_off
split string every N charactersstr_splitter
UnhandledHTTPRequestErrorUnhandledHTTPRequestError vcr_last_error
Use a cassette to record HTTP requestsuse_cassette
Setup vcr for a packageuse_vcr
Global Configuration Optionsvcr_configuration vcr_configure vcr_configure_reset vcr_config_defaults
Locate file in tests directoryvcr_test_path