diff --git a/man/comparison-expectations.Rd b/man/comparison-expectations.Rd index 5cbee6931..ca415bdf8 100644 --- a/man/comparison-expectations.Rd +++ b/man/comparison-expectations.Rd @@ -43,6 +43,7 @@ expect_gt(9, 10) Other expectations: \code{\link{equality-expectations}}, \code{\link{expect_error}()}, +\code{\link{expect_error_forwarded}()}, \code{\link{expect_length}()}, \code{\link{expect_match}()}, \code{\link{expect_named}()}, diff --git a/man/equality-expectations.Rd b/man/equality-expectations.Rd index e22afd695..aa8a9672a 100644 --- a/man/equality-expectations.Rd +++ b/man/equality-expectations.Rd @@ -86,6 +86,7 @@ expect_equal(sqrt(2) ^ 2, 2) Other expectations: \code{\link{comparison-expectations}}, \code{\link{expect_error}()}, +\code{\link{expect_error_forwarded}()}, \code{\link{expect_length}()}, \code{\link{expect_match}()}, \code{\link{expect_named}()}, diff --git a/man/expect_error.Rd b/man/expect_error.Rd index 50851564b..8156c0d40 100644 --- a/man/expect_error.Rd +++ b/man/expect_error.Rd @@ -105,6 +105,10 @@ the captured condition. or condition with a message that matches \code{regexp}, or a class that inherits from \code{class}. See below for more details. +If you need to test that an error, warning, or message is the same as one +given by another package, then see the \code{\link[=expect_error_forwarded]{expect_error_forwarded()}}, +\code{\link[=expect_warning_forwarded]{expect_warning_forwarded()}}, and \code{\link[=expect_message_forwarded]{expect_message_forwarded()}} functions. + In the 3rd edition, these functions match (at most) a single condition. All additional and non-matching (if \code{regexp} or \code{class} are used) conditions will bubble up outside the expectation. If these additional conditions @@ -186,6 +190,7 @@ that code runs without errors/warnings/messages/conditions. Other expectations: \code{\link{comparison-expectations}}, \code{\link{equality-expectations}}, +\code{\link{expect_error_forwarded}()}, \code{\link{expect_length}()}, \code{\link{expect_match}()}, \code{\link{expect_named}()}, diff --git a/man/expect_error_forwarded.Rd b/man/expect_error_forwarded.Rd new file mode 100644 index 000000000..b9e1f8bd9 --- /dev/null +++ b/man/expect_error_forwarded.Rd @@ -0,0 +1,43 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/expect-condition-forwarded.R +\name{expect_error_forwarded} +\alias{expect_error_forwarded} +\alias{expect_warning_forwarded} +\alias{expect_message_forwarded} +\title{Does code throw an error, warning, or message that is the same as another?} +\usage{ +expect_error_forwarded(actual, expected, label = NULL) + +expect_warning_forwarded(actual, expected, label = NULL) + +expect_message_forwarded(actual, expected, label = NULL) +} +\arguments{ +\item{label}{Used to customise failure messages. For expert use only.} +} +\value{ +The value of the first argument +} +\description{ +\code{expect_error_forwarded()}, \code{expect_warning_forwarded()}, and +\code{expect_message_forwarded()}, check that code throws an error, warning, +message, or condition with a message that matches an \code{expected} value from an +example. These functions are useful to test that a condition matches one +from another package that you do not control. +} +\seealso{ +Other expectations: +\code{\link{comparison-expectations}}, +\code{\link{equality-expectations}}, +\code{\link{expect_error}()}, +\code{\link{expect_length}()}, +\code{\link{expect_match}()}, +\code{\link{expect_named}()}, +\code{\link{expect_null}()}, +\code{\link{expect_output}()}, +\code{\link{expect_reference}()}, +\code{\link{expect_silent}()}, +\code{\link{inheritance-expectations}}, +\code{\link{logical-expectations}} +} +\concept{expectations} diff --git a/man/expect_length.Rd b/man/expect_length.Rd index 4e65e8069..2d1004ff1 100644 --- a/man/expect_length.Rd +++ b/man/expect_length.Rd @@ -32,6 +32,7 @@ Other expectations: \code{\link{comparison-expectations}}, \code{\link{equality-expectations}}, \code{\link{expect_error}()}, +\code{\link{expect_error_forwarded}()}, \code{\link{expect_match}()}, \code{\link{expect_named}()}, \code{\link{expect_null}()}, diff --git a/man/expect_match.Rd b/man/expect_match.Rd index 1272f53e3..151a71147 100644 --- a/man/expect_match.Rd +++ b/man/expect_match.Rd @@ -91,6 +91,7 @@ Other expectations: \code{\link{comparison-expectations}}, \code{\link{equality-expectations}}, \code{\link{expect_error}()}, +\code{\link{expect_error_forwarded}()}, \code{\link{expect_length}()}, \code{\link{expect_named}()}, \code{\link{expect_null}()}, diff --git a/man/expect_named.Rd b/man/expect_named.Rd index bfa9ad9fc..a1e36e317 100644 --- a/man/expect_named.Rd +++ b/man/expect_named.Rd @@ -56,6 +56,7 @@ Other expectations: \code{\link{comparison-expectations}}, \code{\link{equality-expectations}}, \code{\link{expect_error}()}, +\code{\link{expect_error_forwarded}()}, \code{\link{expect_length}()}, \code{\link{expect_match}()}, \code{\link{expect_null}()}, diff --git a/man/expect_null.Rd b/man/expect_null.Rd index 45b1adb12..9ad98e2d5 100644 --- a/man/expect_null.Rd +++ b/man/expect_null.Rd @@ -34,6 +34,7 @@ Other expectations: \code{\link{comparison-expectations}}, \code{\link{equality-expectations}}, \code{\link{expect_error}()}, +\code{\link{expect_error_forwarded}()}, \code{\link{expect_length}()}, \code{\link{expect_match}()}, \code{\link{expect_named}()}, diff --git a/man/expect_output.Rd b/man/expect_output.Rd index c7d789f6e..259e9e50e 100644 --- a/man/expect_output.Rd +++ b/man/expect_output.Rd @@ -68,6 +68,7 @@ Other expectations: \code{\link{comparison-expectations}}, \code{\link{equality-expectations}}, \code{\link{expect_error}()}, +\code{\link{expect_error_forwarded}()}, \code{\link{expect_length}()}, \code{\link{expect_match}()}, \code{\link{expect_named}()}, diff --git a/man/expect_reference.Rd b/man/expect_reference.Rd index e5a4b120e..da90fc844 100644 --- a/man/expect_reference.Rd +++ b/man/expect_reference.Rd @@ -44,6 +44,7 @@ Other expectations: \code{\link{comparison-expectations}}, \code{\link{equality-expectations}}, \code{\link{expect_error}()}, +\code{\link{expect_error_forwarded}()}, \code{\link{expect_length}()}, \code{\link{expect_match}()}, \code{\link{expect_named}()}, diff --git a/man/expect_silent.Rd b/man/expect_silent.Rd index 69688a2ec..460349aea 100644 --- a/man/expect_silent.Rd +++ b/man/expect_silent.Rd @@ -35,6 +35,7 @@ Other expectations: \code{\link{comparison-expectations}}, \code{\link{equality-expectations}}, \code{\link{expect_error}()}, +\code{\link{expect_error_forwarded}()}, \code{\link{expect_length}()}, \code{\link{expect_match}()}, \code{\link{expect_named}()}, diff --git a/man/inheritance-expectations.Rd b/man/inheritance-expectations.Rd index 1b2191620..6452dd8ff 100644 --- a/man/inheritance-expectations.Rd +++ b/man/inheritance-expectations.Rd @@ -68,6 +68,7 @@ Other expectations: \code{\link{comparison-expectations}}, \code{\link{equality-expectations}}, \code{\link{expect_error}()}, +\code{\link{expect_error_forwarded}()}, \code{\link{expect_length}()}, \code{\link{expect_match}()}, \code{\link{expect_named}()}, diff --git a/man/logical-expectations.Rd b/man/logical-expectations.Rd index da38c3bde..826255114 100644 --- a/man/logical-expectations.Rd +++ b/man/logical-expectations.Rd @@ -52,6 +52,7 @@ Other expectations: \code{\link{comparison-expectations}}, \code{\link{equality-expectations}}, \code{\link{expect_error}()}, +\code{\link{expect_error_forwarded}()}, \code{\link{expect_length}()}, \code{\link{expect_match}()}, \code{\link{expect_named}()},