-
Notifications
You must be signed in to change notification settings - Fork 12
/
README.Rmd
152 lines (105 loc) · 3.98 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
---
output: github_document
---
vcr
===
```{r echo=FALSE}
knitr::opts_chunk$set(
comment = "#>",
collapse = TRUE,
warning = FALSE,
message = FALSE
)
```
<!-- README.md is generated from README.Rmd. Please edit that file -->
[![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 <https://github.com/vcr/vcr>
## 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