File: configuration.R

package info (click to toggle)
r-cran-vcr 0.6.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,360 kB
  • sloc: cpp: 15; sh: 13; makefile: 2
file content (69 lines) | stat: -rw-r--r-- 2,415 bytes parent folder | download | duplicates (3)
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
## ----echo=FALSE---------------------------------------------------------------
knitr::opts_chunk$set(
	comment = "#>",
	collapse = TRUE,
	warning = FALSE,
	message = FALSE,
	eval = FALSE
)

## -----------------------------------------------------------------------------
#  library("vcr")

## -----------------------------------------------------------------------------
library("vcr")

## -----------------------------------------------------------------------------
vcr_config_defaults()

## -----------------------------------------------------------------------------
vcr_configure(
  dir = "foobar/vcr_cassettes"
)

## -----------------------------------------------------------------------------
vcr_configure(
  dir = "foobar/vcr_cassettes",
  record = "all"
)

## -----------------------------------------------------------------------------
vcr_configure_reset()

## -----------------------------------------------------------------------------
vcr_configure(dir = "new/path")

## -----------------------------------------------------------------------------
vcr_configure(record = "new_episodes")

## -----------------------------------------------------------------------------
vcr_configure(match_requests_on = c('query', 'headers'))

## -----------------------------------------------------------------------------
vcr_configure(allow_unused_http_interactions = FALSE)

## -----------------------------------------------------------------------------
vcr_configure(serialize_with = "yaml")

## -----------------------------------------------------------------------------
vcr_configure(persist_with = "FileSystem")

## -----------------------------------------------------------------------------
vcr_configure(ignore_hosts = "google.com")

## -----------------------------------------------------------------------------
vcr_configure(ignore_localhost = TRUE)

## ----eval=FALSE---------------------------------------------------------------
#  vcr_configure(ignore_hosts = "google.com")
#  use_cassette("foo_bar", {
#    crul::HttpClient$new("https://httpbin.org/get")$get()
#    crul::HttpClient$new("https://google.com")$get()
#  })

## -----------------------------------------------------------------------------
vcr_configure(uri_parser = "urltools::url_parse")

## -----------------------------------------------------------------------------
vcr_configure(preserve_exact_body_bytes = TRUE)