diff --git a/NEWS.md b/NEWS.md index a9ddc93db..8e36cf272 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,7 +4,7 @@ * New `vignette("challenging-functions")` provides an index to other documentation organised by testing challenges (#1265). * When running a test interactively, testthat now reports the number of succeses. The results should also be more useful if you are using nested tests. * The hints generated by `expect_snapshot()` and `expect_snapshot_file()` now include the path to the package, if its not in the current working directory (#1577). -* `expect_snapshot_file()` now clearly errors if the `path` doesnt exist (#2191). +* `expect_snapshot_file()` now clearly errors if the `path` doesn't exist (#2191). * `expect_snapshot_file()` now considers `.json` to be a text file (#1593). * `expect_snapshot_file()` now shows differences for text files (#1593). * The failure messages for all `expect_` functions have been rewritten to first state what was expected and then what was actually received (#2142). @@ -19,7 +19,7 @@ * `local_mock()` and `with_mock()` have been deprecated because they are no longer permitted in R 4.5. * `snapshot_review()` now passes `...` on to `shiny::runApp()` (#1928). * `expect_named()` now gives more informative errors (#2091). -* `expect_*()` functions consistently and rigorously check their inputs (#1754). +* `expect_*()` functions consistently and rigorously check their inputs (#1754). * `test_that()` no longer warns about the absence of `{}` since it no longer seems to be necessary. * `test_that()`, `describe()`, and `it()` can now be arbitrarily nested. Each component will skip only if it and its subtests don't contain any expectations. The interactive stop reporter has been fixed so it doesn't duplicate failures. (#2063, #2188). * Test filtering now works with `it()`, and the `desc` argument can take a character vector in order to recursively filter subtests (i.e. `it()` nested inside of `describe()`) (#2118). @@ -38,7 +38,7 @@ * New `expect_r6_class()` (#2030). * `expect_*()` functions consistently and rigorously check their inputs (#1754). * `JunitReporter()` no longer fails with `"no applicable method for xml_add_child"` for warnings outside of tests (#1913). Additionally, warnings now save their backtraces. -* `JunitReporter()` strips ANSI escapes in more placese (#1852, #2032). +* `JunitReporter()` strips ANSI escapes in more places (#1852, #2032). * `try_again()` is now publicised. The first argument is now the number of retries, not tries (#2050). * `vignette("custom-expectations)` has been overhauled to make it much clearer how to create high-quality expectations (#2113, #2132, #2072). * `expect_snapshot()` and friends will now fail when creating a new snapshot on CI. This is usually a signal that you've forgotten to run it locally before committing (#1461). @@ -987,7 +987,7 @@ This release mostly focusses on an overhaul of how testthat works with condition * In `expect_equal_to_reference()`, the default value for `update` is now `FALSE` (@BrodieG, #683). -* `expect_error()` now returns the error object as documentated (#724). +* `expect_error()` now returns the error object as documented (#724). It also now warns if you're using a classed expectation and you're not using the `class` argument. This is good practice as it decouples the error object (which tends to be stable) from its rendering to the user @@ -1679,7 +1679,7 @@ The reporters system class has been considerably refactored to make existing rep * `safe_digest()` uses a better strategy, and returns NA for directories (#138, #146). -* Random praise is renabled by default (again!) (#164). +* Random praise is re-enabled by default (again!) (#164). * Teamcity reporter now correctly escapes output messages (#150, @windelinckx). It also uses nested suites to include test names. diff --git a/R/expect-self-test.R b/R/expect-self-test.R index 05da3bf9f..a0a565b80 100644 --- a/R/expect-self-test.R +++ b/R/expect-self-test.R @@ -39,7 +39,7 @@ capture_success_failure <- function(expr) { #' Use `show_failure()` in examples to print the failure message without #' throwing an error. #' -#' @param expr Code to evalute +#' @param expr Code to evaluate #' @param message Check that the failure message matches this regexp. #' @param ... Other arguments passed on to [expect_match()]. #' @export diff --git a/R/expect-that.R b/R/expect-that.R index 9579d6f1c..730f3b2fb 100644 --- a/R/expect-that.R +++ b/R/expect-that.R @@ -15,7 +15,7 @@ #' @param srcref Location of the failure. Should only needed to be explicitly #' supplied when you need to forward a srcref captured elsewhere. #' @param trace_env If `trace` is not specified, this is used to generate an -#' informative traceack for failures. You should only need to set this if +#' informative traceback for failures. You should only need to set this if #' you're calling `fail()` from a helper function; see #' `vignette("custom-expectation")` for details. #' @param trace An optional backtrace created by [rlang::trace_back()]. diff --git a/R/mock2.R b/R/mock2.R index 6933d4142..fffdd611e 100644 --- a/R/mock2.R +++ b/R/mock2.R @@ -100,7 +100,7 @@ #' #' To mock a function that returns different values in sequence, #' for instance an API call whose status would be 502 then 200, -#' or an user intput to `readline()`, you can use [mock_output_sequence()] +#' or an user input to `readline()`, you can use [mock_output_sequence()] #' #' ```R #' local_mocked_bindings(readline = mock_output_sequence("3", "This is a note", "n")) diff --git a/R/reporter-stop.R b/R/reporter-stop.R index af61c764e..a992dca9e 100644 --- a/R/reporter-stop.R +++ b/R/reporter-stop.R @@ -2,7 +2,7 @@ #' #' @description #' The default reporter used when [expect_that()] is run interactively. -#' It responds by displaying a summary of the number of successes and faiures +#' It responds by displaying a summary of the number of successes and failures #' and [stop()]ping on if there are any failures. #' #' @export diff --git a/R/test-compiled-code.R b/R/test-compiled-code.R index 5593288af..8544822a6 100644 --- a/R/test-compiled-code.R +++ b/R/test-compiled-code.R @@ -230,8 +230,8 @@ run_cpp_tests <- function(package) { #' \strong{Function} \tab \strong{Catch} \tab \strong{Description} \cr #' `context` \tab `CATCH_TEST_CASE` \tab The context of a set of tests. \cr #' `test_that` \tab `CATCH_SECTION` \tab A test section. \cr -#' `expect_true` \tab `CATCH_CHECK` \tab Test that an expression evaluates to `true`. \cr -#' `expect_false` \tab `CATCH_CHECK_FALSE` \tab Test that an expression evalutes to `false`. \cr +#' `expect_true` \tab `CATCH_CHECK` \tab Test that an expression evaluates to `TRUE`. \cr +#' `expect_false` \tab `CATCH_CHECK_FALSE` \tab Test that an expression evaluates to `FALSE`. \cr #' `expect_error` \tab `CATCH_CHECK_THROWS` \tab Test that evaluation of an expression throws an exception. \cr #' `expect_error_as` \tab `CATCH_CHECK_THROWS_AS` \tab Test that evaluation of an expression throws an exception of a specific class. \cr #' } diff --git a/R/watcher.R b/R/watcher.R index 8c601d767..f06791cf5 100644 --- a/R/watcher.R +++ b/R/watcher.R @@ -9,11 +9,11 @@ #' #' @param path character vector of paths to watch. Omit trailing backslash. #' @param pattern file pattern passed to [dir()] -#' @param callback function called everytime a change occurs. It should +#' @param callback function called every time a change occurs. It should #' have three parameters: added, deleted, modified, and should return -#' TRUE to keep watching, or FALSE to stop. +#' `TRUE` to keep watching, or `FALSE` to stop. #' @param hash hashes are more accurate at detecting changes, but are slower -#' for large files. When FALSE, uses modification time stamps +#' for large files. When `FALSE`, uses modification time stamps #' @export #' @keywords internal watch <- function(path, callback, pattern = NULL, hash = TRUE) { diff --git a/man/StopReporter.Rd b/man/StopReporter.Rd index 012193017..070e73478 100644 --- a/man/StopReporter.Rd +++ b/man/StopReporter.Rd @@ -5,7 +5,7 @@ \title{Error if any test fails} \description{ The default reporter used when \code{\link[=expect_that]{expect_that()}} is run interactively. -It responds by displaying a summary of the number of successes and faiures +It responds by displaying a summary of the number of successes and failures and \code{\link[=stop]{stop()}}ping on if there are any failures. } \seealso{ diff --git a/man/expect.Rd b/man/expect.Rd index c38d2d9b5..b1da702e3 100644 --- a/man/expect.Rd +++ b/man/expect.Rd @@ -29,7 +29,7 @@ When supplied, the expectation is displayed with the backtrace. Expert use only.} \item{trace_env}{If \code{trace} is not specified, this is used to generate an -informative traceack for failures. You should only need to set this if +informative traceback for failures. You should only need to set this if you're calling \code{fail()} from a helper function; see \code{vignette("custom-expectation")} for details.} } diff --git a/man/expect_success.Rd b/man/expect_success.Rd index 644a9d9db..c75de66b5 100644 --- a/man/expect_success.Rd +++ b/man/expect_success.Rd @@ -16,7 +16,7 @@ expect_snapshot_failure(expr) show_failure(expr) } \arguments{ -\item{expr}{Code to evalute} +\item{expr}{Code to evaluate} \item{message}{Check that the failure message matches this regexp.} diff --git a/man/fail.Rd b/man/fail.Rd index 6bf16f5fc..09d9d4350 100644 --- a/man/fail.Rd +++ b/man/fail.Rd @@ -26,7 +26,7 @@ for backward compatibility only and new expectations should not use it.} supplied when you need to forward a srcref captured elsewhere.} \item{trace_env}{If \code{trace} is not specified, this is used to generate an -informative traceack for failures. You should only need to set this if +informative traceback for failures. You should only need to set this if you're calling \code{fail()} from a helper function; see \code{vignette("custom-expectation")} for details.} diff --git a/man/local_mocked_bindings.Rd b/man/local_mocked_bindings.Rd index 3ade3f6a1..4d9d6fd59 100644 --- a/man/local_mocked_bindings.Rd +++ b/man/local_mocked_bindings.Rd @@ -121,7 +121,7 @@ local_mocked_bindings( To mock a function that returns different values in sequence, for instance an API call whose status would be 502 then 200, -or an user intput to \code{readline()}, you can use \code{\link[=mock_output_sequence]{mock_output_sequence()}} +or an user input to \code{readline()}, you can use \code{\link[=mock_output_sequence]{mock_output_sequence()}} \if{html}{\out{