Skip to content

Commit 575f529

Browse files
maelledrmowinckelssckott
authored
vcr updates (#112)
* vcr updates * easier * fix * cli * fix * try * shall -> will = less formal, remove testthat:: as its already loaded (#113) * fix broken links * add link to intro about webmockr * Update _bookdown.yml * Apply suggestion from @sckott Co-authored-by: Scott Chamberlain <[email protected]> * Update wholegames-vcr.Rmd Co-authored-by: Scott Chamberlain <[email protected]> * Update wholegames-vcr.Rmd Co-authored-by: Scott Chamberlain <[email protected]> * Update wholegames-vcr.Rmd Co-authored-by: Scott Chamberlain <[email protected]> --------- Co-authored-by: Athanasia Monika Mowinckel <[email protected]> Co-authored-by: Scott Chamberlain <[email protected]>
1 parent 9da38dd commit 575f529

15 files changed

+116
-223
lines changed

.github/workflows/bookdown.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1616
isExtPR: ${{ github.event.pull_request.head.repo.fork == true }}
1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v5
1919

2020
- uses: r-lib/actions/setup-pandoc@v2
2121

@@ -28,7 +28,7 @@ jobs:
2828
- uses: r-lib/actions/setup-r-dependencies@v2
2929

3030
- name: Cache bookdown results
31-
uses: actions/cache@v2
31+
uses: actions/cache@v4
3232
with:
3333
path: _bookdown_files
3434
key: bookdown-2-${{ hashFiles('**/*Rmd') }}
@@ -40,7 +40,7 @@ jobs:
4040
git config --global user.email "[email protected]"
4141
4242
- name: Build site
43-
run: Rscript -e 'bookdown::render_book("index.Rmd", quiet = TRUE)'
43+
run: Rscript -e 'options(knitr.duplicate.label = "allow");bookdown::render_book("index.Rmd", quiet = TRUE)'
4444

4545
- name: Render book PDF
4646
run: Rscript -e 'bookdown::render_book("index.Rmd", "bookdown::pdf_book", output_dir = "pdfbook")'

07-vcr.Rmd

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,14 @@ Record HTTP calls and replay them
88

99
Check out <https://docs.ropensci.org/vcr/> for documentation on `vcr` functions.
1010

11-
## Terminology {#terminology}
12-
13-
```{r, echo=FALSE}
14-
get_vcr_doc("man/rmdhunks/glossary.Rmd")
15-
```
16-
17-
```{r child='rmd-fragments/man/rmdhunks/glossary.Rmd', eval=TRUE}
18-
```
1911

2012
## Design {#design}
2113

22-
```{r, echo=FALSE}
23-
get_vcr_doc("man/rmdhunks/vcr-design.Rmd")
24-
```
25-
26-
```{r child='rmd-fragments/man/rmdhunks/vcr-design.Rmd', eval=TRUE}
27-
```
14+
https://docs.ropensci.org/vcr/articles/design.html
2815

2916
## Basic usage {#vcr-basic-usage}
3017

31-
```{r, echo=FALSE}
32-
get_vcr_doc("man/rmdhunks/basic-usage.Rmd")
33-
```
34-
35-
```{r child='rmd-fragments/man/rmdhunks/basic-usage.Rmd', eval=TRUE}
36-
```
37-
38-
All components of both the request and response are preserved, so that the HTTP client (in this case `crul`) can reconstruct its own response just as it would if it wasn't using `vcr`.
39-
18+
https://docs.ropensci.org/vcr/articles/vcr.html
4019
## vcr enabled testing {#vcr-enabled-testing}
4120

4221
### check vs. test {#check-vs-test}

09-configuration.Rmd

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,4 @@ knitr::opts_chunk$set(
88

99
# Configure vcr {#vcr-configuration}
1010

11-
```{r, echo=FALSE}
12-
get_vcr_doc("man/rmdhunks/configuration-vignette.Rmd")
13-
```
14-
15-
```{r child='rmd-fragments/man/rmdhunks/configuration-vignette.Rmd', eval=TRUE}
16-
```
11+
https://docs.ropensci.org/vcr/reference/vcr_configure.html

10-record-modes.Rmd

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,4 @@ knitr::opts_chunk$set(
99

1010
# Record modes {#record-modes}
1111

12-
```{r, echo=FALSE}
13-
get_vcr_doc("man/rmdhunks/record-modes.Rmd")
14-
```
15-
16-
```{r child='rmd-fragments/man/rmdhunks/record-modes.Rmd', eval=TRUE}
17-
```
12+
https://docs.ropensci.org/vcr/articles/debugging.html

11-request-matching.Rmd

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,4 @@ knitr::opts_chunk$set(
99

1010
# Request matching {#request-matching}
1111

12-
```{r, echo=FALSE}
13-
get_vcr_doc("man/rmdhunks/request-matching-vignette.Rmd")
14-
```
15-
16-
```{r child='rmd-fragments/man/rmdhunks/request-matching-vignette.Rmd', eval=TRUE}
17-
```
12+
https://docs.ropensci.org/vcr/articles/debugging.html

12-logging.Rmd

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,4 @@ knitr::opts_chunk$set(
99

1010
# Debugging your tests that use vcr
1111

12-
```{r, echo=FALSE}
13-
get_vcr_doc("man/rmdhunks/debugging-vignette.Rmd")
14-
```
15-
16-
```{r child='rmd-fragments/man/rmdhunks/debugging-vignette.Rmd', eval=TRUE}
17-
```
12+
https://docs.ropensci.org/vcr/articles/debugging.html

14-escape-hatches.Rmd

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,4 @@ knitr::opts_chunk$set(
88

99
# Turning vcr on and off {#lightswitch}
1010

11-
```{r, echo=FALSE}
12-
get_vcr_doc("man/rmdhunks/lightswitch.Rmd")
13-
```
14-
15-
```{r child='rmd-fragments/man/rmdhunks/lightswitch.Rmd', eval=TRUE}
16-
```
11+
https://docs.ropensci.org/vcr/reference/lightswitch.html

15-cassettes.Rmd

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@ knitr::opts_chunk$set(
99

1010
# Managing cassettes {#managing-cassettes}
1111

12-
```{r, echo=FALSE}
13-
get_vcr_doc("man/rmdhunks/cassette-editing-vignette.Rmd")
14-
```
15-
16-
```{r child='rmd-fragments/man/rmdhunks/cassette-editing-vignette.Rmd', eval=TRUE}
17-
```
12+
https://docs.ropensci.org/vcr/articles/vcr.html?q=editing#cassette-files
1813

1914
Be aware when you add your cassettes to either `.gitignore` and/or
2015
`.Rbuildignore`.

_bookdown.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ rmd_files: ["index.Rmd",
1616
"10-record-modes.Rmd", "11-request-matching.Rmd", "12-logging.Rmd", "13-security.Rmd",
1717
"14-escape-hatches.Rmd", "15-cassettes.Rmd", "16-gotchas.Rmd",
1818
"18-session-info.Rmd", "404.Rmd"]
19-
before_chapter_script: "_common.R"

_common.R

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)