Skip to content

Commit de2272e

Browse files
committed
More polishing
1 parent 3b7836d commit de2272e

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

R/expect-inheritance.R

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,17 @@
2020
#' See [expect_vector()] for testing properties of objects created by vctrs.
2121
#'
2222
#' @param type String giving base type (as returned by [typeof()]).
23-
#' @param class The different
23+
#' @param class The required type varies depending on the function:
2424
#' * `expect_type()`: a string.
25-
#' * `expect_s3_class()`: a character vector of class names. If you provide
26-
#' multiple class names, the test will pass if `object` inherits from any
27-
#' of them, unless `exact = TRUE`.
28-
#' * `expect_s4_class()`: a string or `NA` to assert that `object` is not an
29-
#' S4 object.
25+
#' * `expect_s3_class()`: a string or character vector. The behaviour of
26+
#' multiple values (i.e. a character vector) is controlled by the
27+
#' `exact` argument.
28+
#' * `expect_s4_class()`: a string.
3029
#' * `expect_r6_class()`: a string.
3130
#' * `expect_s7_class()`: an [S7::S7_class()] object.
3231
#'
33-
#' For historical reasons, `expect_s3_class()` and `expect_s4_class()` take
34-
#' `NA` to assert that the `object` is not an S3 or S4 object.
32+
#' For historical reasons, `expect_s3_class()` and `expect_s4_class()` also
33+
#' take `NA` to assert that the `object` is not an S3 or S4 object.
3534
#' @inheritParams expect_that
3635
#' @family expectations
3736
#' @examples
@@ -87,7 +86,7 @@ expect_type <- function(object, type) {
8786
#' @rdname inheritance-expectations
8887
#' @param exact If `FALSE`, the default, checks that `object` inherits
8988
#' from any element of `class`. If `TRUE`, checks that object has a class
90-
#' that's identical to `class`.
89+
#' that exactly matches `class`.
9190
expect_s3_class <- function(object, class, exact = FALSE) {
9291
check_bool(exact)
9392

man/inheritance-expectations.Rd

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

0 commit comments

Comments
 (0)