-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
95 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ Description: Record test suite 'HTTP' requests and replays them during | |
real 'HTTP' responses on disk in 'cassettes'. Subsequent 'HTTP' requests | ||
matching any previous requests in the same 'cassette' use a cached | ||
'HTTP' response. | ||
Version: 1.2.2.92 | ||
Version: 1.2.2.93 | ||
Authors@R: c(person("Scott", "Chamberlain", role = c("aut", "cre"), | ||
email = "[email protected]", | ||
comment = c(ORCID="0000-0003-1444-9135")), | ||
|
@@ -21,6 +21,7 @@ Authors@R: c(person("Scott", "Chamberlain", role = c("aut", "cre"), | |
person("rOpenSci", role = "fnd", comment = "https://ropensci.org")) | ||
URL: https://github.com/ropensci/vcr/ (devel) | ||
https://books.ropensci.org/http-testing/ (user manual) | ||
https://docs.ropensci.org/vcr/ (website) | ||
BugReports: https://github.com/ropensci/vcr/issues | ||
License: MIT + file LICENSE | ||
Encoding: UTF-8 | ||
|
@@ -50,7 +51,8 @@ Suggests: | |
crayon, | ||
cli, | ||
curl, | ||
withr | ||
withr, | ||
webfakes | ||
Remotes: ropensci/webmockr@httr2 | ||
X-schema.org-applicationCategory: Web | ||
X-schema.org-keywords: http, https, API, web-services, curl, mock, mocking, http-mocking, testing, testing-tools, tdd | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,33 @@ | ||
# Platform | ||
|
||
|field |value | | ||
|:--------|:----------------------------| | ||
|version |R version 4.1.0 (2021-05-18) | | ||
|os |macOS Big Sur 10.16 | | ||
|system |x86_64, darwin17.0 | | ||
|ui |X11 | | ||
|language |(EN) | | ||
|collate |en_US.UTF-8 | | ||
|ctype |en_US.UTF-8 | | ||
|tz |US/Pacific | | ||
|date |2021-05-31 | | ||
|field |value | | ||
|:--------|:-----------------------------------| | ||
|version |R version 4.3.2 (2023-10-31) | | ||
|os |macOS Ventura 13.6.3 | | ||
|system |aarch64, darwin20 | | ||
|ui |X11 | | ||
|language |(EN) | | ||
|collate |en_US.UTF-8 | | ||
|ctype |en_US.UTF-8 | | ||
|tz |America/Los_Angeles | | ||
|date |2024-01-09 | | ||
|pandoc |3.1.11.1 @ /opt/homebrew/bin/pandoc | | ||
|
||
# Dependencies | ||
|
||
|package |old |new |Δ | | ||
|:-------|:-----|:-----|:--| | ||
|vcr |1.0.0 |1.0.2 |* | | ||
|package |old |new |Δ | | ||
|:---------|:-----|:--------|:--| | ||
|vcr |1.2.2 |1.2.2.91 |* | | ||
|askpass |NA |1.2.0 |* | | ||
|curl |NA |5.2.0 |* | | ||
|httr |NA |1.4.7 |* | | ||
|openssl |NA |2.1.1 |* | | ||
|Rcpp |NA |1.0.11 |* | | ||
|rprojroot |NA |2.0.4 |* | | ||
|sys |NA |3.4.2 |* | | ||
|triebeard |NA |0.4.1 |* | | ||
|whisker |NA |0.4.1 |* | | ||
|yaml |NA |2.3.8 |* | | ||
|
||
# Revdeps | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# orginally via https://github.com/ropensci/vcr/issues/264 | ||
|
||
tmpdir <- tempdir() | ||
vcr_configure(dir = tmpdir) | ||
|
||
test_that("testing against localhost port works", { | ||
# httpbin <- webfakes::local_app_process(webfakes::httpbin_app()) | ||
httpbin <- local_httpbin_app() | ||
url <- httpbin$url("/status/404") | ||
port <- httpbin$get_port() | ||
|
||
# real request w/o vcr | ||
resp <- httr::GET(url) | ||
expect_s3_class(resp, "response") | ||
|
||
# real request w/ vcr | ||
use_cassette("localhost_port", { | ||
resp <- httr::GET(url) | ||
# check that response object is correct | ||
expect_s3_class(resp, "response") | ||
}) | ||
|
||
# check that the port is actually in the cassette file | ||
path <- file.path(tmpdir, "localhost_port.yml") | ||
file <- yaml::yaml.load_file(path) | ||
url <- file$http_interactions[[1]]$request$uri | ||
expect_is(url, "character") | ||
expect_match(url, "http://.+:[0-9]+/") | ||
expect_match(url, as.character(port)) | ||
}) | ||
|
||
# reset configuration | ||
vcr_configure_reset() |