Skip to content

Commit 85eab44

Browse files
authored
Merge branch 'r-lib:main' into main
2 parents e679de8 + f060cce commit 85eab44

File tree

6 files changed

+17
-13
lines changed

6 files changed

+17
-13
lines changed

β€ŽR/describe.Rβ€Ž

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#' describe: a BDD testing language
22
#'
3-
#' A simple BDD DSL for writing tests. The language is similar to RSpec for
4-
#' Ruby or Mocha for JavaScript. BDD tests read like sentences and it should
5-
#' thus be easier to understand what the specification of a function/component
6-
#' is.
3+
#' A simple [behavior-driven development
4+
#' (BDD)](https://en.wikipedia.org/wiki/Behavior-driven_development)
5+
#' [domain-specific language](https://en.wikipedia.org/wiki/Domain-specific_language)
6+
#' for writing tests. The language is similar to [RSpec](https://rspec.info/)
7+
#' for Ruby or [Mocha](https://mochajs.org/) for JavaScript. BDD tests read
8+
#' like sentences and it should thus be easier to understand what the
9+
#' specification of a function/component is.
710
#'
811
#' Tests using the `describe` syntax not only verify the tested code, but
912
#' also document its intended behaviour. Each `describe` block specifies a
@@ -12,7 +15,6 @@
1215
#' functions as a test and is evaluated in its own environment. You
1316
#' can also have nested `describe` blocks.
1417
#'
15-
#'
1618
#' This test syntax helps to test the intended behaviour of your code. For
1719
#' example: you want to write a new function for your package. Try to describe
1820
#' the specification first using `describe`, before your write any code.

β€ŽR/reporter.Rβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#' Manage test reporting
22
#'
33
#' The job of a reporter is to aggregate the results from files, tests, and
4-
#' expectations and display them in an informative way. Every testtthat function
4+
#' expectations and display them in an informative way. Every testthat function
55
#' that runs multiple tests provides a `reporter` argument which you can
66
#' use to override the default (which is selected by [default_reporter()]).
77
#'

β€Žman/Reporter.Rdβ€Ž

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žman/describe.Rdβ€Ž

Lines changed: 6 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žvignettes/special-files.Rmdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ In principle, you should be able to be run your test files in any order or even
3333

3434
## Helper files
3535

36-
Helper files live in `tests/testtthat/`, start with `helper`, and end with `.r` or `.R`.
36+
Helper files live in `tests/testthat/`, start with `helper`, and end with `.r` or `.R`.
3737
They are sourced by `devtools::load_all()` (so they're available interactively when developing your packages) and by `test_check()` and friends (so that they're available no matter how your tests are executed).
3838

3939
Helper files are a useful place for functions that you've extracted from repeated code in your tests, whether that be test fixtures (`vignette("test-fixtures")`), custom expectations (`vignette("custom-expectations")`), or skip helpers (`vignette("skipping")`).

β€Žvignettes/test-fixtures.Rmdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ neat <- function(x, sig_digits) {
133133

134134
Second, it works when called in the global environment. Since the global environment isn't perishable, like a test environment is, you have to call `deferred_run()` explicitly to execute the deferred events. You can also clear them, without running, with `deferred_clear()`.
135135

136-
```{r}
136+
```{r, eval = FALSE}
137137
withr::defer(print("hi"))
138138
#> Setting deferred event(s) on global environment.
139139
#> * Execute (and clear) with `deferred_run()`.

0 commit comments

Comments
Β (0)