Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ropensci/vcr
Record HTTP calls and replay them
https://github.com/ropensci/vcr
mocking r r-package rstats testing unit-testing vcr
Last synced: 3 months ago
JSON representation
Record HTTP calls and replay them
- Host: GitHub
- URL: https://github.com/ropensci/vcr
- Owner: ropensci
- License: other
- Created: 2014-12-09T17:38:38.000Z (almost 10 years ago)
- Default Branch: main
- Last Pushed: 2024-07-27T05:00:23.000Z (3 months ago)
- Last Synced: 2024-07-27T06:21:10.863Z (3 months ago)
- Topics: mocking, r, r-package, rstats, testing, unit-testing, vcr
- Language: R
- Homepage: https://docs.ropensci.org/vcr
- Size: 1.48 MB
- Stars: 78
- Watchers: 6
- Forks: 12
- Open Issues: 34
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Codemeta: codemeta.json
Awesome Lists containing this project
- jimsghstars - ropensci/vcr - Record HTTP calls and replay them (R)
README
---
output: github_document
---vcr
===```{r echo=FALSE}
knitr::opts_chunk$set(
comment = "#>",
collapse = TRUE,
warning = FALSE,
message = FALSE
)
```[![cran checks](https://badges.cranchecks.info/worst/vcr.svg)](https://cloud.r-project.org/web/checks/check_results_vcr.html)
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![R-check](https://github.com/ropensci/vcr/workflows/R-check/badge.svg)](https://github.com/ropensci/vcr/actions/)
[![codecov](https://codecov.io/gh/ropensci/vcr/branch/main/graph/badge.svg)](https://app.codecov.io/gh/ropensci/vcr)
[![rstudio mirror downloads](https://cranlogs.r-pkg.org/badges/vcr)](https://github.com/r-hub/cranlogs.app)
[![cran version](https://www.r-pkg.org/badges/version/vcr)](https://cran.r-project.org/package=vcr)Easier HTTP testing! Record HTTP requests and responses on disk and replay them for the unit tests of your R package, to make them independent from any connection, faster, and more complete. An R port of the Ruby gem [vcr](https://github.com/vcr/vcr)
## Elevator pitch
```{r child='man/rmdhunks/elevator-pitch.Rmd'}
```## Installation
CRAN version:
```{r eval=FALSE}
install.packages("vcr")
```Development version:
```{r eval=FALSE}
# install.packages("pak")
pak::pak("ropensci/vcr")
``````{r}
library("vcr")
library("crul")
```## Docs
Check out the [HTTP testing book](https://books.ropensci.org/http-testing/) and the [vcr vignettes](https://docs.ropensci.org/vcr/articles/).
## Supported HTTP libraries
* [crul][]
* [httr](https://httr.r-lib.org/)
* [httr2](https://httr2.r-lib.org/)## Getting Started
```{r child='man/rmdhunks/setup.Rmd'}
```## Usage
```{r child='man/rmdhunks/basic-usage.Rmd'}
```## Terminology
```{r child='man/rmdhunks/glossary.Rmd'}
```## Workflows
```{r child='man/rmdhunks/workflows.Rmd'}
```### How it works in lots of detail
See the [vignette about internals](https://docs.ropensci.org/vcr/articles/internals.html)
### Just want to mock and not store on disk?
You're looking for [webmockr][], that vcr itself uses.
`webmockr` only matches requests based on criteria you choose, but does not cache HTTP interactions to disk as `vcr` does.## Configuration
```{r child='man/rmdhunks/configuration.Rmd'}
```## Matching/Matchers
```{r child='man/rmdhunks/matching.Rmd'}
```## vcr in other languages
The canonical `vcr` (in Ruby) lists ports in other languages at
## Note about missing features
```{r child='man/rmdhunks/missing-features.Rmd'}
```## Example packages using vcr
* [allcontributors][]
* [bold][]
* [qualtRics][]
* [rgbif][]
* [ritis][]
* [rredlist][]
* [rtoot][]
* [rtweet][]
* [wikitaxa][]
* [worrms][]## Contributors
* [Scott Chamberlain](https://github.com/sckott)
* [Aaron Wolen](https://github.com/aaronwolen)
* [Maëlle Salmon](https://github.com/maelle)
* [Daniel Possenriede](https://github.com/dpprdan)## Meta
* Please [report any issues or bugs](https://github.com/ropensci/vcr/issues)
* License: MIT
* Get citation information for `vcr` in R doing `citation(package = 'vcr')`
* Please note that this package is released with a [Contributor Code of Conduct](https://ropensci.org/code-of-conduct/). By contributing to this project, you agree to abide by its terms.[allcontributors]: https://github.com/ropenscilabs/allcontributors
[bold]: https://github.com/ropensci/bold
[crul]: https://docs.ropensci.org/crul/
[qualtRics]: https://github.com/ropensci/qualtRics
[rgbif]: https://github.com/ropensci/rgbif
[ritis]: https://github.com/ropensci/ritis
[rredlist]: https://github.com/ropensci/rredlist
[rtoot]: https://github.com/gesistsa/rtoot
[rtweet]: https://github.com/ropensci/rtweet
[webmockr]: https://docs.ropensci.org/webmockr/
[wikitaxa]: https://github.com/ropensci/wikitaxa
[worrms]: https://github.com/ropensci/worrms