diff --git a/codemeta.json b/codemeta.json index 65bdcc3..31f3f82 100644 --- a/codemeta.json +++ b/codemeta.json @@ -227,7 +227,7 @@ "keywords": ["http", "https", "API", "web-services", "curl", "mock", "mocking", "http-mocking", "testing", "testing-tools", "tdd", "unit-testing", "rstats", "vcr", "r", "r-package"], "contIntegration": "https://travis-ci.org/ropenscilabs/vcr", "readme": "https://github.com/ropensci/vcr/blob/master/README.md", - "fileSize": "73.927KB", + "fileSize": "73.897KB", "relatedLink": "https://ropenscilabs.github.io/http-testing-book/", "releaseNotes": "https://github.com/ropensci/vcr/blob/master/NEWS.md", "developmentStatus": "http://www.repostatus.org/#wip", diff --git a/docs/articles/configuration.html b/docs/articles/configuration.html index cdc9d1d..b17731d 100644 --- a/docs/articles/configuration.html +++ b/docs/articles/configuration.html @@ -91,7 +91,7 @@
vignettes/configuration.Rmd
configuration.Rmd
vignettes/request_matching.Rmd
request_matching.Rmd
vignettes/vcr.Rmd
vcr.Rmd
The request gets recorded, and all subsequent requests of the same form used the cached HTTP response, and so are much faster
system.time(
use_cassette(name = "helloworld", {
@@ -137,7 +137,7 @@
})
)
#> user system elapsed
-#> 0.070 0.005 0.076
Importantly, your unit test deals with the same inputs and the same outputs - but behind the scenes you use a cached HTTP response - thus, your tests run faster.
The cached response looks something like (condensed for brevity):
http_interactions:
diff --git a/docs/reference/Cassette.html b/docs/reference/Cassette.html
index 0e4b03b..83a240a 100644
--- a/docs/reference/Cassette.html
+++ b/docs/reference/Cassette.html
@@ -221,14 +221,14 @@ See a
Examples
#> <vcr configuration>
-#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpYxsTis
+#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//Rtmp3gxCi6
#> Record: once
#> URI Parser: crul::url_parse
#> Match Requests on: method, uri
#> Preserve Bytes?: FALSE
#> Logging?: FALSE#> [1] "/var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpYxsTis/bob.yml"res$originally_recorded_at()#> [1] "2019-08-19 17:19:45 PDT"res$recording()#> [1] TRUEres$serializable_hash()#> $http_interactions
+res$file()#> [1] "/var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//Rtmp3gxCi6/bob.yml"res$originally_recorded_at()#> [1] "2019-08-20 11:58:49 PDT"res$recording()#> [1] TRUEres$serializable_hash()#> $http_interactions
#> list()
#>
#> $recorded_with
@@ -244,7 +244,7 @@ Examp
#> allow_playback_repeats: FALSE
#> allow_unused_http_interactions: TRUE
#> exclusive: FALSE
-#> preserve_exact_body_bytes: FALSE
res$should_remove_matching_existing_interactions()#> [1] TRUEres$storage_key()#> [1] "/var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpYxsTis/bob.yml"res$match_requests_on#> [1] "method" "uri"
+#> preserve_exact_body_bytes: FALSEres$should_remove_matching_existing_interactions()#> [1] TRUEres$storage_key()#> [1] "/var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//Rtmp3gxCi6/bob.yml"res$match_requests_on#> [1] "method" "uri"
# record all requests
res <- Cassette$new("foobar", record = "all")
res$eject()#> #> #> #> <vcr - Cassette> foobar
diff --git a/docs/reference/Persisters.html b/docs/reference/Persisters.html
index c695d65..aeecd07 100644
--- a/docs/reference/Persisters.html
+++ b/docs/reference/Persisters.html
@@ -194,7 +194,7 @@ Examp
#> get_cassette: function (file_name = NULL)
#> initialize: function (file_name = NULL, write_fxn = NULL, content = NULL,
#> is_empty: function ()
-#> path: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpYxsTis
+#> path: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//Rtmp3gxCi6
#> set_cassette: function (file_name = NULL, content)
#> write_fxn: NULL
#> write2disk: FALSE
diff --git a/docs/reference/UnhandledHTTPRequestError.html b/docs/reference/UnhandledHTTPRequestError.html
index 4635672..047eded 100644
--- a/docs/reference/UnhandledHTTPRequestError.html
+++ b/docs/reference/UnhandledHTTPRequestError.html
@@ -180,7 +180,7 @@ Examples
#> <vcr configuration>
-#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpYxsTis
+#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//Rtmp3gxCi6
#> Record: once
#> URI Parser: crul::url_parse
#> Match Requests on: method, uri
@@ -201,7 +201,7 @@ Examp
err <- UnhandledHTTPRequestError$new(request)
err$request_description()
#> [1] "POST https://eu.httpbin.org/post?a=5"err$current_matchers()#> [1] "method" "uri" err$match_request_on_headers()#> [1] FALSEerr$match_request_on_body()#> [1] FALSEerr$formatted_headers()#> [1] " foo: bar"#> foo: bar #> vcr is currently using the following cassette:
-#> - /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpYxsTis/turtle.yml
+#> - /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//Rtmp3gxCi6/turtle.yml
#> - record_mode: once
#> - match_requests_on: method, uri
#>
@@ -209,7 +209,7 @@ Examp
#> to replay and is prevented from recording new requests. There are a few ways
#> you can deal with this:
#>
#> vcr is currently using the following cassette:
-#> - /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpYxsTis/turtle.yml
+#> - /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//Rtmp3gxCi6/turtle.yml
#> - record_mode: once
#> - match_requests_on: method, uri err$formatted_suggestions()#> [1] " * If you're surprised vcr is raising this error\n and want insight about how vcr attempted to handle the request,\n you can use 'logging' to see more details [1].\n\n * You can use the :new_episodes record mode to allow vcr to\n record this new request to the existing cassette [2].\n\n * If you want vcr to ignore this request (and others like it), you can\n set an `ignore_request` function [3].\n\n * The current record mode ('once') does not allow new requests to be recorded\n to a previously recorded cassette. You can delete the cassette file and re-run\n your tests to allow the cassette to be recorded with this request [4].\n\n[1] https://ropenscilabs.github.io/http-testing-book/logging\n\n[2] https://ropenscilabs.github.io/http-testing-book/record-modes.html#new_episodes\n\n[3] https://ropenscilabs.github.io/http-testing-book/vcr-configuration#config-ignore-requests\n\n[4] https://ropenscilabs.github.io/http-testing-book/record-modes.html#once\n"#> * foo bar [2]. err$suggestion_for("use_new_episodes")#> $text
#> [1] "You can use the :new_episodes record mode to allow vcr to"
diff --git a/docs/reference/cassettes.html b/docs/reference/cassettes.html
index 0801c53..700172f 100644
--- a/docs/reference/cassettes.html
+++ b/docs/reference/cassettes.html
@@ -172,7 +172,7 @@ Details
Examples
#> <vcr configuration>
-#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpYxsTis
+#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//Rtmp3gxCi6
#> Record: once
#> URI Parser: crul::url_parse
#> Match Requests on: method, uri
@@ -250,13 +250,13 @@ Examp
#> preserve_exact_body_bytes: FALSE
#>
# list the path to cassettes
-cassette_path()#> [1] "/var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpYxsTis"#> <vcr configuration>
-#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpYxsTis/foo
+cassette_path()#> [1] "/var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//Rtmp3gxCi6"#> <vcr configuration>
+#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//Rtmp3gxCi6/foo
#> Record: once
#> URI Parser: crul::url_parse
#> Match Requests on: method, uri
#> Preserve Bytes?: FALSE
-#> Logging?: FALSEcassette_path()#> [1] "/var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpYxsTis/foo"
+#> Logging?: FALSEcassette_path()#> [1] "/var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//Rtmp3gxCi6/foo"#> <vcr configuration>
#> Cassette Dir: .
#> Record: once
diff --git a/docs/reference/eject_cassette.html b/docs/reference/eject_cassette.html
index f27e89a..31be017 100644
--- a/docs/reference/eject_cassette.html
+++ b/docs/reference/eject_cassette.html
@@ -170,7 +170,7 @@ See a
Examples
#> <vcr configuration>
-#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpYxsTis
+#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//Rtmp3gxCi6
#> Record: once
#> URI Parser: crul::url_parse
#> Match Requests on: method, uri
diff --git a/docs/reference/vcr_configure.html b/docs/reference/vcr_configure.html
index 88d2fb6..b5e445d 100644
--- a/docs/reference/vcr_configure.html
+++ b/docs/reference/vcr_configure.html
@@ -272,19 +272,19 @@ Arg
Examples
#> <vcr configuration>
-#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpYxsTis
+#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//Rtmp3gxCi6
#> Record: once
#> URI Parser: crul::url_parse
#> Match Requests on: method, uri
#> Preserve Bytes?: FALSE
#> Logging?: FALSE#> <vcr configuration>
-#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpYxsTis
+#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//Rtmp3gxCi6
#> Record: all
#> URI Parser: crul::url_parse
#> Match Requests on: method, uri
#> Preserve Bytes?: FALSE
#> Logging?: FALSEvcr_configuration()#> <vcr configuration>
-#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpYxsTis
+#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//Rtmp3gxCi6
#> Record: all
#> URI Parser: crul::url_parse
#> Match Requests on: method, uri
@@ -357,7 +357,7 @@ Examp
#> $filter_sensitive_data
#> NULL
#>
#> <vcr configuration>
-#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpYxsTis
+#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//Rtmp3gxCi6
#> Record: once
#> URI Parser: crul::url_parse
#> Match Requests on: method, uri
@@ -366,13 +366,13 @@ Examp
# logging
vcr_configure(tempdir(), log = TRUE,
log_opts = list(file = file.path(tempdir(), "vcr.log")))
#> <vcr configuration>
-#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpYxsTis
+#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//Rtmp3gxCi6
#> Record: once
#> URI Parser: crul::url_parse
#> Match Requests on: method, uri
#> Preserve Bytes?: FALSE
-#> Logging?: TRUE (/var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpYxsTis/vcr.log)#> <vcr configuration>
-#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpYxsTis
+#> Logging?: TRUE (/var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//Rtmp3gxCi6/vcr.log)#> <vcr configuration>
+#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//Rtmp3gxCi6
#> Record: once
#> URI Parser: crul::url_parse
#> Match Requests on: method, uri
@@ -382,13 +382,13 @@ Examp
file = file.path(tempdir(), "vcr.log"),
log_prefix = "foobar"
))
#> <vcr configuration>
-#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpYxsTis
+#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//Rtmp3gxCi6
#> Record: once
#> URI Parser: crul::url_parse
#> Match Requests on: method, uri
#> Preserve Bytes?: FALSE
-#> Logging?: TRUE (/var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpYxsTis/vcr.log)#> <vcr configuration>
-#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpYxsTis
+#> Logging?: TRUE (/var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//Rtmp3gxCi6/vcr.log)#> <vcr configuration>
+#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//Rtmp3gxCi6
#> Record: once
#> URI Parser: crul::url_parse
#> Match Requests on: method, uri
@@ -398,7 +398,7 @@ Examp
vcr_configure(tempdir(),
filter_sensitive_data = list(foo = "<bar>")
)
#> <vcr configuration>
-#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpYxsTis
+#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//Rtmp3gxCi6
#> Record: once
#> URI Parser: crul::url_parse
#> Match Requests on: method, uri
@@ -406,7 +406,7 @@ Examp
#> Logging?: FALSE
#> <vcr configuration>
-#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpYxsTis
+#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//Rtmp3gxCi6
#> Record: once
#> URI Parser: crul::url_parse
#> Match Requests on: method, uri
diff --git a/docs/reference/vcr_logging.html b/docs/reference/vcr_logging.html
index a8129a2..cdfe5ef 100644
--- a/docs/reference/vcr_logging.html
+++ b/docs/reference/vcr_logging.html
@@ -166,56 +166,56 @@ Arg
Examples
# user workflow
vcr_configuration()#> <vcr configuration>
-#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpYxsTis
+#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//Rtmp3gxCi6
#> Record: once
#> URI Parser: crul::url_parse
#> Match Requests on: method, uri
#> Preserve Bytes?: FALSE
#> Logging?: FALSElogfile <- file.path(tempdir(), "vcr.log")
vcr_configure(tempdir(), log = TRUE, log_opts = list(file = logfile))#> <vcr configuration>
-#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpYxsTis
+#> Cassette Dir: /var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//Rtmp3gxCi6
#> Record: once
#> URI Parser: crul::url_parse
#> Match Requests on: method, uri
#> Preserve Bytes?: FALSE
-#> Logging?: TRUE (/var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//RtmpYxsTis/vcr.log)
+#> Logging?: TRUE (/var/folders/fc/n7g_vrvn0sx_st0p8lxb3ts40000gn/T//Rtmp3gxCi6/vcr.log)#> character(0)#> [1] "[Cassette: '<none>'] - 2019-08-19 17:19:51 - hello world!"#> [1] "[Cassette: '<none>'] - 2019-08-19 17:19:51 - hello world!"
-#> [2] "[Cassette: '<none>'] - 2019-08-19 17:19:51 - foo bar" #> [1] "[Cassette: '<none>'] - 2019-08-20 11:58:59 - hello world!"#> [1] "[Cassette: '<none>'] - 2019-08-20 11:58:59 - hello world!"
+#> [2] "[Cassette: '<none>'] - 2019-08-20 11:58:59 - foo bar" #> [1] "[Cassette: '<none>'] - 2019-08-19 17:19:51 - hello world!"
-#> [2] "[Cassette: '<none>'] - 2019-08-19 17:19:51 - foo bar"
-#> [3] "[Cassette: '<none>'] - 2019-08-19 17:19:51 - brown cow"
-#> [4] "[Cassette: '<none>'] - 2019-08-19 17:19:51 - blue horse" #> [1] "[Cassette: '<none>'] - 2019-08-19 17:19:51 - hello world!"
-#> [2] "[Cassette: '<none>'] - 2019-08-19 17:19:51 - foo bar"
-#> [3] "[Cassette: '<none>'] - 2019-08-19 17:19:51 - brown cow"
-#> [4] "[Cassette: '<none>'] - 2019-08-19 17:19:51 - blue horse"
-#> [5] "[Cassette: '<none>'] - 2019-08-19 17:19:51 - brown cow"
-#> [6] "[Cassette: '<none>'] - 2019-08-19 17:19:51 - blue horse"
-#> [7] "[Cassette: '<none>'] - 2019-08-19 17:19:51 - green goat"
+readLines(logfile)#> [1] "[Cassette: '<none>'] - 2019-08-20 11:58:59 - hello world!"
+#> [2] "[Cassette: '<none>'] - 2019-08-20 11:58:59 - foo bar"
+#> [3] "[Cassette: '<none>'] - 2019-08-20 11:58:59 - brown cow"
+#> [4] "[Cassette: '<none>'] - 2019-08-20 11:58:59 - blue horse" #> [1] "[Cassette: '<none>'] - 2019-08-20 11:58:59 - hello world!"
+#> [2] "[Cassette: '<none>'] - 2019-08-20 11:58:59 - foo bar"
+#> [3] "[Cassette: '<none>'] - 2019-08-20 11:58:59 - brown cow"
+#> [4] "[Cassette: '<none>'] - 2019-08-20 11:58:59 - blue horse"
+#> [5] "[Cassette: '<none>'] - 2019-08-20 11:58:59 - brown cow"
+#> [6] "[Cassette: '<none>'] - 2019-08-20 11:58:59 - blue horse"
+#> [7] "[Cassette: '<none>'] - 2019-08-20 11:58:59 - green goat" #> [1] TRUE#> character(0)#> [1] "[Cassette: '<none>'] - 2019-08-19 17:19:51 - hello world!"
-#> [2] "[Cassette: '<none>'] - 2019-08-19 17:19:51 - foo bar"
-#> [3] "[Cassette: '<none>'] - 2019-08-19 17:19:51 - brown cow"
-#> [4] "[Cassette: '<none>'] - 2019-08-19 17:19:51 - blue horse"
-#> [5] "[Cassette: '<none>'] - 2019-08-19 17:19:51 - brown cow"
-#> [6] "[Cassette: '<none>'] - 2019-08-19 17:19:51 - blue horse"
-#> [7] "[Cassette: '<none>'] - 2019-08-19 17:19:51 - green goat" #> [1] "[Cassette: '<none>'] - 2019-08-19 17:19:51 - hello world!"
-#> [2] "[Cassette: '<none>'] - 2019-08-19 17:19:51 - foo bar"
-#> [3] "[Cassette: '<none>'] - 2019-08-19 17:19:51 - brown cow"
-#> [4] "[Cassette: '<none>'] - 2019-08-19 17:19:51 - blue horse"
-#> [5] "[Cassette: '<none>'] - 2019-08-19 17:19:51 - brown cow"
-#> [6] "[Cassette: '<none>'] - 2019-08-19 17:19:51 - blue horse"
-#> [7] "[Cassette: '<none>'] - 2019-08-19 17:19:51 - green goat"
+readLines(logfile)#> [1] "[Cassette: '<none>'] - 2019-08-20 11:58:59 - hello world!"
+#> [2] "[Cassette: '<none>'] - 2019-08-20 11:58:59 - foo bar"
+#> [3] "[Cassette: '<none>'] - 2019-08-20 11:58:59 - brown cow"
+#> [4] "[Cassette: '<none>'] - 2019-08-20 11:58:59 - blue horse"
+#> [5] "[Cassette: '<none>'] - 2019-08-20 11:58:59 - brown cow"
+#> [6] "[Cassette: '<none>'] - 2019-08-20 11:58:59 - blue horse"
+#> [7] "[Cassette: '<none>'] - 2019-08-20 11:58:59 - green goat" #> [1] "[Cassette: '<none>'] - 2019-08-20 11:58:59 - hello world!"
+#> [2] "[Cassette: '<none>'] - 2019-08-20 11:58:59 - foo bar"
+#> [3] "[Cassette: '<none>'] - 2019-08-20 11:58:59 - brown cow"
+#> [4] "[Cassette: '<none>'] - 2019-08-20 11:58:59 - blue horse"
+#> [5] "[Cassette: '<none>'] - 2019-08-20 11:58:59 - brown cow"
+#> [6] "[Cassette: '<none>'] - 2019-08-20 11:58:59 - blue horse"
+#> [7] "[Cassette: '<none>'] - 2019-08-20 11:58:59 - green goat"