Skip to content

Commit a01e18a

Browse files
authored
Fix vignette typos (#1215)
* Fix vignette typos * Wrong function * Remove doubling * Plural * Add missing word
1 parent 87b41b4 commit a01e18a

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

R/snapshot-file.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
#' expect_snapshot_file(save_png(hist(mtcars)), "plot.png")
4242
#' }
4343
#'
44-
#' # You'd then also provide a helper that skip tests where you can't
44+
#' # You'd then also provide a helper that skips tests where you can't
4545
#' # be sure of producing exactly the same output
4646
#' expect_snapshot_plot <- function(name, code) {
4747
#' # Other packages might affect results

man/expect_snapshot_file.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vignettes/snapshotting.Rmd

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ set.seed(1014)
1616
```
1717

1818
The goal of a unit test is to record the expected output of a function using code.
19-
This is a powerful technique because because not only does it ensure that code doesn't change unexpectedly, it also expresses the desired behaviour in a way that a human can understand.
19+
This is a powerful technique because not only does it ensure that code doesn't change unexpectedly, it also expresses the desired behaviour in a way that a human can understand.
2020

2121
However, it's not always convenient to record the expected behaviour with code.
2222
Some challenges include:
@@ -151,7 +151,7 @@ Within a test, each snapshot expectation is indented by four spaces, i.e. as cod
151151

152152
### Interactive usage
153153

154-
Because the snapshot output uses the the name of the current test file and the current test, snapshot expectations don't really work when run interactively at the console.
154+
Because the snapshot output uses the name of the current test file and the current test, snapshot expectations don't really work when run interactively at the console.
155155
Since they can't automatically find the reference output, they instead just print the current value for manual inspection.
156156

157157
## Other types of snapshot
@@ -169,9 +169,9 @@ Since they can't automatically find the reference output, they instead just prin
169169
But that doesn't work for all file types --- for example, what happens if you want to snapshot an image?
170170
`expect_snapshot_file()` provides an alternative workflow that generates one snapshot per expectation, rather than one file per test.
171171
Assuming you're in `test-burger.R` then the snapshot created by `expect_snapshot_file(code_that_returns_path_to_file(), "toppings.png")` would be saved in `tests/testthat/_snaps/burger/toppings.png`.
172-
If a future change in the code creates a a different file it will be saved in `tests/testthat/_snaps/burger/toppings.new.png`.
172+
If a future change in the code creates a different file it will be saved in `tests/testthat/_snaps/burger/toppings.new.png`.
173173

174-
Unlike `expect_snapshot()` and friends, `expect_snapshot()` can't automatically provide an automatic diff when the test fails.
174+
Unlike `expect_snapshot()` and friends, `expect_snapshot_file()` can't provide an automatic diff when the test fails.
175175
Instead you'll need to call `snapshot_review()`.
176176
This launches a Shiny app that allows you to visually review each change and approve it if it's deliberate:
177177

vignettes/test-fixtures.Rmd

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ knitr::opts_chunk$set(
2222
>
2323
> ― Chief Si'ahl
2424
25-
Ideally, a test should leave the world exactly as it found it. But you often need to make some changes in order exercise every part of your code:
25+
Ideally, a test should leave the world exactly as it found it. But you often need to make some changes in order to exercise every part of your code:
2626

2727
- Create a file or directory
2828
- Create a resource on an external system

vignettes/third-edition.Rmd

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ You'll have to explicit ignore them with `supressMesssages()`, or if they're imp
100100

101101
### waldo
102102

103-
Probably the the biggest day-to-day difference (and the biggest reason to upgrade!) is the use of [`waldo::compare()`](https://waldo.r-lib.org/reference/compare.html) inside of `expect_equal()` and `expect_identical()`.
103+
Probably the biggest day-to-day difference (and the biggest reason to upgrade!) is the use of [`waldo::compare()`](https://waldo.r-lib.org/reference/compare.html) inside of `expect_equal()` and `expect_identical()`.
104104
The goal of waldo is to find and concisely describe the difference between a pair of R objects, and it's designed specifically to help you figure out what's gone wrong in your unit tests.
105105

106106
```{r, error = TRUE}

0 commit comments

Comments
 (0)